Show Menu
Cheatography

PowerShell Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Variables

$PSScr­iptRoot
Path of the current script file
$env:P­SMo­dul­ePath
Module instal­lation paths

One Liners

Get-Ch­ildItem Env:
List all enviro­nment variables
 

Common Commands

$PSVer­sio­nTable
Determine PowerShell version
Get-Co­mmand cmd
Similar to
which
command in bash
Measur­e-C­ommand { block }
Measure execution time of block

Splatting

@
Splatting operator (can be used with arrays or hashta­bles)