PowerShell Alias Decoder
Paste a PowerShell one-liner and get it back with full cmdlet names: gci, ?, %, -ea 0 and 170 more, with the 5.1, PowerShell 7 and Linux differences.
Scripts from forums, colleagues and your own history are full of shorthand: gci -r | ? {...} | % {...}.
Paste one here and get it back with every alias written out, ready to read, review or save as a script, plus what
changes between Windows PowerShell 5.1, PowerShell 7 and PowerShell on Linux (where ls and curl
mean something else). Only command names and parameters are changed (-r becomes -Recurse, -ea 0 becomes -ErrorAction SilentlyContinue, resolved the way PowerShell itself resolves them); strings, comments,
paths and everything else stay exactly as you wrote them. Based on Microsoft's
about_Aliases,
about_CommonParameters,
5.1 vs 7 differences and
non-Windows differences.
Decoded in your browser. Your script is never sent to tclient.com.
This page runs on your device (WebAssembly). To check, open your browser's developer tools (F12), go to the Network tab and paste a script: no request is made.
It runs in
Every built-in alias
171 aliases from Windows PowerShell 5.1 and PowerShell 7.6, including the ones that only exist on Windows or in one version.
171 aliases
| Alias | Runs | Where it works |
|---|---|---|
| dir | Get-ChildItem | Everywhere |
Note: CMD and Linux switches don't work here: use -Recurse (not /s or -R), -Force for hidden files (not /a or -a) and -Filter or -Include for patterns. | ||
| gci | Get-ChildItem | Everywhere |
| ls | Get-ChildItem | Windows only (Linux and macOS run the native ls) |
Note: CMD and Linux switches don't work here: use -Recurse (not /s or -R), -Force for hidden files (not /a or -a) and -Filter or -Include for patterns. | ||
| copy | Copy-Item | Everywhere |
Note: Copying a folder needs -Recurse; without it only the folder itself is created, empty. | ||
| cp | Copy-Item | Windows only (Linux and macOS run the native cp) |
Note: Copying a folder needs -Recurse; without it only the folder itself is created, empty. | ||
| cpi | Copy-Item | Everywhere |
| move | Move-Item | Everywhere |
| mv | Move-Item | Windows only (Linux and macOS run the native mv) |
| mi | Move-Item | Everywhere |
| del | Remove-Item | Everywhere |
Note: A folder that isn't empty needs -Recurse; add -Force for hidden and read-only files. Unix-style rm -rf fails because there's no -rf parameter. | ||
| erase | Remove-Item | Everywhere |
Note: A folder that isn't empty needs -Recurse; add -Force for hidden and read-only files. Unix-style rm -rf fails because there's no -rf parameter. | ||
| rd | Remove-Item | Everywhere |
Note: A folder that isn't empty needs -Recurse; add -Force for hidden and read-only files. Unix-style rm -rf fails because there's no -rf parameter. | ||
| rmdir | Remove-Item | Windows only (Linux and macOS run the native rmdir) |
Note: A folder that isn't empty needs -Recurse; add -Force for hidden and read-only files. Unix-style rm -rf fails because there's no -rf parameter. | ||
| rm | Remove-Item | Windows only (Linux and macOS run the native rm) |
Note: A folder that isn't empty needs -Recurse; add -Force for hidden and read-only files. Unix-style rm -rf fails because there's no -rf parameter. | ||
| ri | Remove-Item | Everywhere |
| ren | Rename-Item | Everywhere |
| rni | Rename-Item | Everywhere |
| ni | New-Item | Everywhere |
Note: New-Item -ItemType Directory creates a folder (and any missing parent folders); -ItemType File creates an empty file. | ||
| md | mkdir | Everywhere |
Note: mkdir is a built-in function that runs New-Item -ItemType Directory, creating any missing parent folders too. | ||
| gi | Get-Item | Everywhere |
| si | Set-Item | Everywhere |
| cli | Clear-Item | Everywhere |
| ii | Invoke-Item | Everywhere |
Note: Opens a file with its default program, like double-clicking it. ii . opens the current folder in File Explorer. | ||
| cvpa | Convert-Path | Everywhere |
| rvpa | Resolve-Path | Everywhere |
| gp | Get-ItemProperty | Everywhere |
Note: Reads registry values as well as file properties: gp HKLM:\SOFTWARE\... | ||
| gpv | Get-ItemPropertyValue | Everywhere |
| sp | Set-ItemProperty | Everywhere |
| clp | Clear-ItemProperty | Everywhere |
| cpp | Copy-ItemProperty | Windows only (Linux and macOS run the native cpp) |
| mp | Move-ItemProperty | Everywhere |
| rnp | Rename-ItemProperty | Everywhere |
| rp | Remove-ItemProperty | Everywhere |
| Alias | Runs | Where it works |
|---|---|---|
| cat | Get-Content | Windows only (Linux and macOS run the native cat) |
Note: Returns the file as an array of lines. Add -Raw for one string, -Tail 20 for the end of a file, and -Wait to keep following it like tail -f. | ||
| gc | Get-Content | Everywhere |
Note: Returns the file as an array of lines. Add -Raw for one string, -Tail 20 for the end of a file, and -Wait to keep following it like tail -f. | ||
| type | Get-Content | Everywhere |
Note: Returns the file as an array of lines. Add -Raw for one string, -Tail 20 for the end of a file, and -Wait to keep following it like tail -f. | ||
| sc | Set-Content | Windows PowerShell 5.1 only |
Note: In Windows PowerShell 5.1, sc is Set-Content, not the Service Control tool: sc query tries to write a file called query. Type sc.exe for services. | ||
| ac | Add-Content | Windows only (Linux and macOS run the native ac) |
| clc | Clear-Content | Everywhere |
| sls | Select-String | Everywhere |
Note: PowerShell's grep and findstr: sls 'error' *.log. Regular expressions by default; add -SimpleMatch for plain text. | ||
| tee | Tee-Object | Windows only (Linux and macOS run the native tee) |
| fhx | Format-Hex | Everywhere |
| CFS | ConvertFrom-String | Windows PowerShell 5.1 only |
| Alias | Runs | Where it works |
|---|---|---|
| cd | Set-Location | Everywhere |
Note: cd.. and cd\ also work without a space (they're built-in functions). cd - goes back to the previous folder in PowerShell 6.2 and later. | ||
| chdir | Set-Location | Everywhere |
| sl | Set-Location | Everywhere |
| pwd | Get-Location | Everywhere |
| gl | Get-Location | Everywhere |
| pushd | Push-Location | Everywhere |
| popd | Pop-Location | Everywhere |
| gdr | Get-PSDrive | Everywhere |
| ndr | New-PSDrive | Everywhere |
| mount | New-PSDrive | Windows only (Linux and macOS run the native mount) |
Note: The drive only exists inside this PowerShell session unless you add -Persist (Windows, network drives). | ||
| rdr | Remove-PSDrive | Everywhere |
| Alias | Runs | Where it works |
|---|---|---|
| ? | Where-Object | Everywhere |
Note: where here is Where-Object, not CMD's where.exe. To find a program on the PATH, type where.exe or use Get-Command. | ||
| where | Where-Object | Everywhere |
Note: where here is Where-Object, not CMD's where.exe. To find a program on the PATH, type where.exe or use Get-Command. | ||
| % | ForEach-Object | Everywhere |
Note: After a pipe this is ForEach-Object. At the start of a statement, foreach ($x in $list) is the foreach loop instead, which collects everything first. | ||
| foreach | ForEach-Object | Everywhere |
Note: After a pipe this is ForEach-Object. At the start of a statement, foreach ($x in $list) is the foreach loop instead, which collects everything first. | ||
| select | Select-Object | Everywhere |
Note: Picks properties or the -First and -Last items. It doesn't search text; that's Select-String (sls). | ||
| sort | Sort-Object | Windows only (Linux and macOS run the native sort) |
Note: Sorts objects by property: use -Descending, -Unique and -Property. Unix flags like -r and -n don't exist. | ||
| group | Group-Object | Everywhere |
| measure | Measure-Object | Everywhere |
| compare | Compare-Object | Windows only (Linux and macOS run the native compare) |
Note: Compares two collections of objects. For two files compare (Get-Content a.txt) with (Get-Content b.txt); it isn't a line-by-line diff like diff or fc. | ||
| diff | Compare-Object | Windows only (Linux and macOS run the native diff) |
Note: Compares two collections of objects. For two files compare (Get-Content a.txt) with (Get-Content b.txt); it isn't a line-by-line diff like diff or fc. | ||
| gu | Get-Unique | Everywhere |
Note: Only removes duplicates that are next to each other, so sort first (or use Sort-Object -Unique). | ||
| gm | Get-Member | Everywhere |
Note: Lists the properties and methods of whatever you pipe to it. The quickest way to find out what you're working with. | ||
| epcsv | Export-Csv | Everywhere |
Note: Windows PowerShell 5.1 adds a #TYPE line at the top unless you use -NoTypeInformation; PowerShell 7 doesn't. | ||
| ipcsv | Import-Csv | Everywhere |
| Alias | Runs | Where it works |
|---|---|---|
| echo | Write-Output | Everywhere |
Note: Sends objects down the pipeline, so in a function they become its return value. For a message that only goes to the screen, use Write-Host. | ||
| write | Write-Output | Windows only (Linux and macOS run the native write) |
Note: Sends objects down the pipeline, so in a function they become its return value. For a message that only goes to the screen, use Write-Host. | ||
| ft | Format-Table | Everywhere |
Note: Format-* cmdlets make display text, not objects: put them last in a pipeline, never before Export-Csv or a filter. | ||
| fl | Format-List | Everywhere |
Note: fl * shows every property, including the ones the default view hides. | ||
| fw | Format-Wide | Everywhere |
| fc | Format-Custom | Everywhere |
Note: Not CMD's fc file compare: here fc is Format-Custom. Type fc.exe to compare files. | ||
| oh | Out-Host | Everywhere |
| ogv | Out-GridView | Windows only (no Out-GridView on Linux or macOS) |
Note: Opens a sortable, filterable window. Needs a desktop session. | ||
| lp | Out-Printer | Windows PowerShell 5.1 only |
| cls | Clear-Host | Everywhere |
Note: Clears the screen. | ||
| clear | Clear-Host | Windows only (Linux and macOS run the native clear) |
Note: Clears the screen. | ||
| gcb | Get-Clipboard | Everywhere |
| scb | Set-Clipboard | Everywhere |
Note: Pipe anything to scb to copy it: Get-Content log.txt | scb. | ||
| Alias | Runs | Where it works |
|---|---|---|
| ps | Get-Process | Windows only (Linux and macOS run the native ps) |
| gps | Get-Process | Everywhere |
| kill | Stop-Process | Windows only (Linux and macOS run the native kill) |
Note: Takes a process ID or -Name. Unix signals (kill -9) aren't supported; -Force ends the process without asking. | ||
| spps | Stop-Process | Everywhere |
Note: Takes a process ID or -Name. Unix signals (kill -9) aren't supported; -Force ends the process without asking. | ||
| start | Start-Process | Windows only (Linux and macOS run the native start) |
Note: Add -Wait to wait for the program to finish and -Verb RunAs to run it as administrator. | ||
| saps | Start-Process | Everywhere |
| sleep | Start-Sleep | Windows only (Linux and macOS run the native sleep) |
Note: Takes seconds by default (sleep 5); use -Milliseconds for shorter waits. | ||
| gsv | Get-Service | Windows only (no Get-Service on Linux or macOS) |
| sasv | Start-Service | Windows only (no Start-Service on Linux or macOS) |
| spsv | Stop-Service | Windows only (no Stop-Service on Linux or macOS) |
| gin | Get-ComputerInfo | Windows only (no Get-ComputerInfo on Linux or macOS) |
| gtz | Get-TimeZone | Everywhere |
| stz | Set-TimeZone | Windows only (no Set-TimeZone on Linux or macOS) |
| Alias | Runs | Where it works |
|---|---|---|
| gcm | Get-Command | Everywhere |
Note: gcm notepad shows which program, function or alias a name runs, like where.exe or which. | ||
| man | help | Windows only (Linux and macOS run the native man) |
Note: help is a built-in function that shows Get-Help one page at a time. Add -Online for the Microsoft Learn page. | ||
| iex | Invoke-Expression | Everywhere |
Note: Runs a string as code. Read anything downloaded before piping it to iex (iwr ... | iex runs whatever the server sends). | ||
| ipmo | Import-Module | Everywhere |
| gmo | Get-Module | Everywhere |
Note: Shows loaded modules; gmo -ListAvailable shows installed ones. | ||
| rmo | Remove-Module | Everywhere |
| nmo | New-Module | Everywhere |
| shcm | Show-Command | Windows only (no Show-Command on Linux or macOS) |
| trcm | Trace-Command | Windows PowerShell 5.1 only |
| asnp | Add-PSSnapIn | Windows PowerShell 5.1 only |
| gsnp | Get-PSSnapIn | Windows PowerShell 5.1 only |
| rsnp | Remove-PSSnapin | Windows PowerShell 5.1 only |
| ise | powershell_ise.exe | Windows PowerShell 5.1 only |
| Alias | Runs | Where it works |
|---|---|---|
| gv | Get-Variable | Everywhere |
| sv | Set-Variable | Everywhere |
| set | Set-Variable | Everywhere |
Note: Not CMD's set: this is Set-Variable. Environment variables are $env:NAME = 'value', and dir env: lists them. | ||
| nv | New-Variable | Everywhere |
| rv | Remove-Variable | Everywhere |
| clv | Clear-Variable | Everywhere |
| gal | Get-Alias | Everywhere |
Note: gal -Definition Get-ChildItem lists every alias for a cmdlet. | ||
| sal | Set-Alias | Everywhere |
Note: An alias can't include parameters; write a small function for that. Aliases you set last until the session ends unless they're in your profile. | ||
| nal | New-Alias | Everywhere |
| epal | Export-Alias | Everywhere |
| ipal | Import-Alias | Everywhere |
| Alias | Runs | Where it works |
|---|---|---|
| h | Get-History | Everywhere |
| history | Get-History | Everywhere |
| ghy | Get-History | Everywhere |
| r | Invoke-History | Everywhere |
Note: Runs a command from your history again: on its own it reruns the last one, r 12 reruns entry 12. | ||
| ihy | Invoke-History | Everywhere |
Note: Runs a command from your history again: on its own it reruns the last one, r 12 reruns entry 12. | ||
| clhy | Clear-History | Everywhere |
| gerr | Get-Error | PowerShell 7 only |
Note: Shows everything about the most recent error (or $Error[n]): exception type, stack and inner exceptions. | ||
| gcs | Get-PSCallStack | Everywhere |
| sbp | Set-PSBreakpoint | Everywhere |
| gbp | Get-PSBreakpoint | Everywhere |
| ebp | Enable-PSBreakpoint | Everywhere |
| dbp | Disable-PSBreakpoint | Everywhere |
| rbp | Remove-PSBreakpoint | Everywhere |
| Alias | Runs | Where it works |
|---|---|---|
| icm | Invoke-Command | Everywhere |
Note: Variables from your session aren't visible on the remote computer; pass them with $using:name or -ArgumentList. | ||
| etsn | Enter-PSSession | Everywhere |
| exsn | Exit-PSSession | Everywhere |
| nsn | New-PSSession | Everywhere |
| gsn | Get-PSSession | Everywhere |
| rsn | Remove-PSSession | Everywhere |
| cnsn | Connect-PSSession | Windows only (no Connect-PSSession on Linux or macOS) |
| dnsn | Disconnect-PSSession | Windows only (no Disconnect-PSSession on Linux or macOS) |
| rcsn | Receive-PSSession | Windows only (no Receive-PSSession on Linux or macOS) |
| epsn | Export-PSSession | Windows PowerShell 5.1 only |
| ipsn | Import-PSSession | Windows PowerShell 5.1 only |
| npssc | New-PSSessionConfigurationFile | Windows PowerShell 5.1 only |
| sajb | Start-Job | Everywhere |
| gjb | Get-Job | Everywhere |
| rcjb | Receive-Job | Everywhere |
| wjb | Wait-Job | Everywhere |
| spjb | Stop-Job | Everywhere |
| rjb | Remove-Job | Everywhere |
| rujb | Resume-Job | Windows PowerShell 5.1 only |
| sujb | Suspend-Job | Windows PowerShell 5.1 only |
| Alias | Runs | Where it works |
|---|---|---|
| iwr | Invoke-WebRequest | Everywhere |
Note: Windows PowerShell 5.1 parses pages with Internet Explorer's engine unless you add -UseBasicParsing; PowerShell 7 always parses the basic way. | ||
| irm | Invoke-RestMethod | Everywhere |
Note: Turns JSON and XML responses into objects you can use straight away. | ||
| curl | Invoke-WebRequest | Windows PowerShell 5.1 only |
Note: In Windows PowerShell 5.1, curl is Invoke-WebRequest, so curl options like -I, -L or -k fail. Type curl.exe for the real curl. PowerShell 7 dropped the alias, so there curl runs curl.exe. | ||
| wget | Invoke-WebRequest | Windows PowerShell 5.1 only |
Note: In Windows PowerShell 5.1, wget is Invoke-WebRequest, not GNU wget. Use iwr URL -OutFile file to download. PowerShell 7 dropped the alias. | ||
| gwmi | Get-WmiObject | Windows PowerShell 5.1 only |
Note: Use Get-CimInstance (gcim) instead: it does the same job and works in 5.1 and 7. | ||
| iwmi | Invoke-WMIMethod | Windows PowerShell 5.1 only |
Note: Use Invoke-CimMethod (icim) instead; it works in 5.1 and 7. | ||
| rwmi | Remove-WMIObject | Windows PowerShell 5.1 only |
Note: Use Remove-CimInstance (rcim) instead; it works in 5.1 and 7. | ||
| swmi | Set-WMIInstance | Windows PowerShell 5.1 only |
Note: Use Set-CimInstance (scim) instead; it works in 5.1 and 7. | ||
| gcim | Get-CimInstance | Windows only (no Get-CimInstance on Linux or macOS) |
Note: gcim Win32_OperatingSystem, gcim Win32_LogicalDisk: the modern replacement for gwmi. | ||
| gcls | Get-CimClass | Windows only (no Get-CimClass on Linux or macOS) |
| gcai | Get-CimAssociatedInstance | Windows only (no Get-CimAssociatedInstance on Linux or macOS) |
| icim | Invoke-CimMethod | Windows only (no Invoke-CimMethod on Linux or macOS) |
| ncim | New-CimInstance | Windows only (no New-CimInstance on Linux or macOS) |
| rcim | Remove-CimInstance | Windows only (no Remove-CimInstance on Linux or macOS) |
| scim | Set-CimInstance | Windows only (no Set-CimInstance on Linux or macOS) |
| gcms | Get-CimSession | Windows only (no Get-CimSession on Linux or macOS) |
| ncms | New-CimSession | Windows only (no New-CimSession on Linux or macOS) |
| rcms | Remove-CimSession | Windows only (no Remove-CimSession on Linux or macOS) |
| ncso | New-CimSessionOption | Windows only (no New-CimSessionOption on Linux or macOS) |
| rcie | Register-CimIndicationEvent | Windows only (no Register-CimIndicationEvent on Linux or macOS) |