PowerShell v2 v3 Quick Way to List Automatic Variable Names

Nothing more than a tidbit to remind myself:
(get-help about_Automatic_Variables) -split "`n" | where {$_ -match ^    $}
This should spit out something like this in v3:
$$
$?
$^
$_
$Args
$ConsoleFileName
$Error
$EventArgs
$EventSubscriber
$ExecutionContext
$False
$ForEach
$Home
$Host
$Input
$LastExitCode
$Matches
$MyInvocation
$NestedPromptLevel
$NULL
$PID
$Profile
$PSBoundParameters
$PsCmdlet
$PSCommandPath
$PsCulture
$PSDebugContext
$PsHome
$PSScriptRoot
$PSSenderInfo
$PsUICulture
$PsVersionTable
$Pwd
$ReportErrorShowExceptionClass
$ReportErrorShowInnerException
$ReportErrorShowSource
$ReportErrorShowStackTrace
$Sender
$ShellID
$StackTrace
$This
$True

Related Posts by Categories

0 comments:

Post a Comment