# 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