Jumat, 16 September 2016

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

lamsim

About lamsim

Author Description here.. Nulla sagittis convallis. Curabitur consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et, nibh. Duis vulputate elit in elit. Mauris dictum libero id justo.

Subscribe to this Blog via Email :