cheatsheet
Cheatsheat for Powershell
| Comment | # This is a comment in a Powershell script |
Write-Host "Hello World!" |
|
| Arguments | param( |
| if | If (condition) {# Do stuff} Else {# Do other stuff} |
| for | for ($i=1; $i -le 10; $i++) {# Do stuff} |
| while | while(($i -ne 0){# Do stuff} |
| function | function my-f{ |
| function call | my-f P1 P2 |
| Exit | Exit() |