# List all processes using > 100 MB of PagedMemory in descending sort order
C:\PS> Get-Process | Where {$_.PagedMemorySize -gt 100MB} | Sort -Desc
# PowerShell can also evaluate expressions
C:\PS> "Hello World!"
Hello World!
C:\PS> (98.6 - 32) * 5/9
37
# Production orientation allows experimenationexperimentation 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):
add section on enabling script execution (a step commonly needed for new users)
Ben N
- 42.6k
- 17
- 154
- 196
ChrisF
- 41.6k
- 18
- 104
- 156