Wednesday, August 22, 2007

A few nice variables

Obtaining the name of the current script: $myInvocation.MyCommand.Name
Path to Powershell executable: $PSHome
Get environment variables: $env:username or $env:logonserver
List all available environment variables: dir env: (note that no $ is included)
Show last commandline entered: $line
Current Path: $pwd

No comments: