💠
PowerShell Shortcuts
Terminal
By EZ4Code Team
Cmdlets
6| Shortcut | Description | Platform |
|---|---|---|
| Get-Help | Show help for cmdlet | all |
| Get-Command | List all commands | all |
| Get-ChildItem | List items (ls) | all |
| Set-Location | Change directory (cd) | all |
| Copy-Item | Copy item (cp) | all |
| Remove-Item | Remove item (rm) | all |
Pipeline
6| Shortcut | Description | Platform |
|---|---|---|
| | | Pipe output to next command | all |
| | Select-Object | Select properties | all |
| | Where-Object | Filter objects | all |
| | Sort-Object | Sort objects | all |
| | ForEach-Object | Iterate objects | all |
| | Export-Csv | Export to CSV | all |
Variables
6| Shortcut | Description | Platform |
|---|---|---|
| $var = value | Assign variable | all |
| $env:PATH | Access environment variable | all |
| $_ | Current pipeline object | all |
| $PSItem | Current pipeline object (alias) | all |
| Get-Variable | List all variables | all |
| Remove-Variable | Delete variable | all |
Functions
5| Shortcut | Description | Platform |
|---|---|---|
| function Name {} | Define function | all |
| param() | Declare parameters | all |
| return | Return value | all |
| Get-Command -CommandType Function | List functions | all |
| Remove-Item Function:Name | Remove function | all |
Remoting
6| Shortcut | Description | Platform |
|---|---|---|
| Enter-PSSession | Start interactive session | all |
| Exit-PSSession | End session | all |
| Invoke-Command | Run command remotely | all |
| New-PSSession | Create persistent session | all |
| Get-PSSession | List sessions | all |
| Remove-PSSession | Close session | all |