Skip to main content
Fixed the weird syntax highlighting (as a result, the diff looks more extensive than it really is - use view "Side-by-side Markdown" to compare) [2].
Source Link
Peter Mortensen
  • 31.1k
  • 22
  • 111
  • 134
C:\PS> function Greet($fname, $lname) {"My name is '$lname', '$fname' '$lname'"} C:\PS> Greet('James','Bond') # Wrong way to invoke this function!! My name is '', 'James Bond' '' 
C:\PS> function Greet($fname, $lname) {"My name is '$lname', '$fname' '$lname'"} C:\PS> Greet('James','Bond') # Wrong way to invoke this function!! My name is '', 'James Bond' '' 
C:\PS> function Greet($fname, $lname) {"My name is '$lname', '$fname' '$lname'"} C:\PS> Greet('James','Bond') # Wrong way to invoke this function!! My name is '', 'James Bond' '' 
C:\PS> function Greet($fname, $lname) {"My name is '$lname', '$fname' '$lname'"} C:\PS> Greet('James','Bond') # Wrong way to invoke this function!! My name is '', 'James Bond' '' 
Fixed the weird syntax highlighting (as a result, the diff looks more extensive than it really is - use view "Side-by-side Markdown" to compare).
Source Link
Peter Mortensen
  • 31.1k
  • 22
  • 111
  • 134
# List all processes using > 100 MB of PagedMemory in descending sort order (v3_ C:\PS> Get-Process | Where PagedMemorySize -GT 100MB | Sort -Descending # PowerShell can handle numbers and arithmetic C:\PS> (98.6 - 32) * 5/9 37 # Production orientation allows experimentation and confirmation C:\PS> Get-ChildItem C:\Users\John *.bak -r | Where {$_.LastWriteTime -gt (Get-Date).AddDays(-7)} | Remove-Item -WhatIf What if: Performing operation "Remove File" on Target "C:\Users\John\foo.bak" C:\PS> Get-Process iexp* | Stop-Process -Confirm Confirm Are you sure you want to perform this action? Performing operation "Stop-Process" on Target "iexplore (7116)". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is Y): 
# List all processes using > 100 MB of PagedMemory in descending sort order (v3_ C:\PS> Get-Process | Where PagedMemorySize -GT 100MB | Sort -Descending # PowerShell can handle numbers and arithmetic C:\PS> (98.6 - 32) * 5/9 37 # Production orientation allows experimentation and confirmation C:\PS> Get-ChildItem C:\Users\John *.bak -r | Where {$_.LastWriteTime -gt (Get-Date).AddDays(-7)} | Remove-Item -WhatIf What if: Performing operation "Remove File" on Target "C:\Users\John\foo.bak" C:\PS> Get-Process iexp* | Stop-Process -Confirm Confirm Are you sure you want to perform this action? Performing operation "Stop-Process" on Target "iexplore (7116)". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is Y): 
C:\PS> & 'C:\Program Files\Windows NT\Accessories\wordpad.exe' 
C:\PS> & 'C:\Program Files\Windows NT\Accessories\wordpad.exe' 
C:\PS> Greet James Bond My name is 'Bond', 'James' 'Bond' 
C:\PS> Greet James Bond My name is 'Bond', 'James' 'Bond' 
%UserProfile%\Documents\WindowsPowerShell 
%UserProfile%\Documents\WindowsPowerShell 
# List all processes using > 100 MB of PagedMemory in descending sort order (v3_ C:\PS> Get-Process | Where PagedMemorySize -GT 100MB | Sort -Descending # PowerShell can handle numbers and arithmetic C:\PS> (98.6 - 32) * 5/9 37 # Production orientation allows experimentation and confirmation C:\PS> Get-ChildItem C:\Users\John *.bak -r | Where {$_.LastWriteTime -gt (Get-Date).AddDays(-7)} | Remove-Item -WhatIf What if: Performing operation "Remove File" on Target "C:\Users\John\foo.bak" C:\PS> Get-Process iexp* | Stop-Process -Confirm Confirm Are you sure you want to perform this action? Performing operation "Stop-Process" on Target "iexplore (7116)". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is Y): 
C:\PS> & 'C:\Program Files\Windows NT\Accessories\wordpad.exe' 
C:\PS> Greet James Bond My name is 'Bond', 'James' 'Bond' 
%UserProfile%\Documents\WindowsPowerShell 
# List all processes using > 100 MB of PagedMemory in descending sort order (v3_ C:\PS> Get-Process | Where PagedMemorySize -GT 100MB | Sort -Descending # PowerShell can handle numbers and arithmetic C:\PS> (98.6 - 32) * 5/9 37 # Production orientation allows experimentation and confirmation C:\PS> Get-ChildItem C:\Users\John *.bak -r | Where {$_.LastWriteTime -gt (Get-Date).AddDays(-7)} | Remove-Item -WhatIf What if: Performing operation "Remove File" on Target "C:\Users\John\foo.bak" C:\PS> Get-Process iexp* | Stop-Process -Confirm Confirm Are you sure you want to perform this action? Performing operation "Stop-Process" on Target "iexplore (7116)". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is Y): 
C:\PS> & 'C:\Program Files\Windows NT\Accessories\wordpad.exe' 
C:\PS> Greet James Bond My name is 'Bond', 'James' 'Bond' 
%UserProfile%\Documents\WindowsPowerShell 
Added Server Fault to suggested places for administration
Source Link
Loading
Updated dead/inaccessible links to achieve links or new links
Source Link
Loading
Corrected profile path, added PSGallery,PSMagazine and a repeated word
Source Link
Loading
Added PowerShell.org link and correct PowerShell team blog url
Source Link
Loading
Copy edited (e.g. ref. <http://english.stackexchange.com/questions/4645/is-it-ever-correct-to-have-a-space-before-a-question-or-exclamation-mark#comment206109_4645> and <http://stackoverflow.com/legal/trademark-guidance> (the last section)).
Source Link
Loading
Loading
Added usage guidelines
Source Link
Machavity
  • 31.8k
  • 27
  • 97
  • 107
Loading
Cleaned up first paragraph of tag description slightly.
Source Link
Loading
Slightly modified first sentence to state the specific Windows versions in which PowerShell was first introduced, for historical context.
Source Link
Loading
removing outdated links
Source Link
Martin Prikryl
  • 205.5k
  • 64
  • 564
  • 1.1k
Loading
Adding info on "PSReadLine" -- probably the top must-have utility for powershell
Source Link
Loading
Fixed grammar errors and clumsy wording; removed a bit of redundancy in the .NET-based explanation
Source Link
Loading
Added "New features in Powershell version 5" link
Source Link
Loading
Loading
added 113 characters in body
Source Link
JPBlanc
  • 73.1k
  • 18
  • 138
  • 180
Loading