Linked Questions

3 votes
0 answers
2k views

I'm trying to create a powershell alias for my ng build command which is fairly long. node --max_old_space_size=4096 .\node_modules\@angular\cli\bin\ng build --configuration=debug --watch Aliasing the ...
Chris S.'s user avatar
1 vote
0 answers
2k views

I have a python program that creates a numbered list up to the value i enter I have tried using new-alias numberlist "python C:\path\to\file\numberlist.py" to do this but it returns the ...
Mathias's user avatar
  • 103
410 votes
22 answers
482k views

Out-File seems to force the BOM when using UTF-8: $MyFile = Get-Content $MyPath $MyFile | Out-File -Encoding "UTF8" $MyPath How can I write a file in UTF-8 with no BOM using PowerShell? ...
sourcenouveau's user avatar
55 votes
10 answers
46k views

I've written function 'A' that will call one of a number of other functions. To save re-writing function 'A', I'd like to pass the function to be called as a parameter of function 'A'. For example: ...
woter324's user avatar
  • 3,250
17 votes
1 answer
14k views

I am a novice with PowerShell. In Msys2 (or Lnux), I have defined a function npp npp () { ${NPP_PATH} "$@" } such that if I call from the command prompt npp it launches Notepad++ (as ...
sancho.s ReinstateMonicaCellio's user avatar
17 votes
1 answer
68k views

Is there a PowerShell equivalent to the ls -al command in Linux/Unix? I tried to find something, but it said there wasn't an equivalent command in PowerShell.
butlertj10's user avatar
9 votes
3 answers
2k views

Command that output the result in string instead of objects: ls | Out-String -Stream Output: Directory: C:\MyPath\dir1 Mode LastWriteTime Length Name ---- ...
iotop's user avatar
  • 105
4 votes
2 answers
3k views

I am writing a script and I want to pass the values but also see them displayed Get-Content data.txt | Tee-Object | data_processor.exe But Tee-Object always requests a file and I just want to see it ...
Sled's user avatar
  • 19.2k
7 votes
1 answer
4k views

Im setting up my powershell profile to create aliases of commonly used commands. On Microsoft's documentation it says, if I want to make an alias for a command with parameters, I should make the value ...
nreh's user avatar
  • 526
5 votes
3 answers
2k views

I'm writing a script that will perform some git actions and I want to use Start-Transcript to monitor it. The transcript is however missing most of the git output. I've tried to pipe the git output ...
Zam's user avatar
  • 1,426
-4 votes
1 answer
6k views

I am a newcomer to PS scripting. I have found that, generally speaking, PS adds a lot of newlines to output of its commands. I am giving below a couple of examples of what I found somewhat generalized ...
sancho.s ReinstateMonicaCellio's user avatar
5 votes
2 answers
2k views

Consider the following simple function: function Write-HostIfNotVerbose() { if ($VerbosePreference -eq 'SilentlyContinue') { Write-Host @args } } And it works fine: Now I want to ...
mark's user avatar
  • 63.6k
2 votes
1 answer
2k views

I'm using the below code to display the results of PowerShell Jobs with a timeout of 120 seconds. I would like to enhance this code by incorporating Write-Progress (based on number of jobs completed)....
MKANET's user avatar
  • 683
2 votes
1 answer
2k views

I was wondering if there's any simple way to make aliases for powershell like cmd. For example: In cmd, doskey art=php artisan $* where $* is optional. Currently, I'm using the following alias in ...
JawadR1's user avatar
  • 399
1 vote
1 answer
1k views

I'm writing a function that wraps a cmdlet using ValueFromRemainingArguments (as discussed here). The following simple code demonstrates the problem: works function Test-WrapperArgs { Set-...
Thorsten's user avatar
  • 326

15 30 50 per page