Windows PowerShell Automatic Variables | |
---|---|
Variables automatically used and set by Windows PowerShell | |
Variable | Meaning |
| Last token of the last line received by the shell. |
| Success/fail status of the last operation. |
| First token of the last line received by the shell. |
| Current pipeline object in a pipelined script block. |
| Array of parameters passed to the script, function, or scriptblock. |
| Preference that controls the level of
impact that operations may have before requesting confirmation.
Supports the values |
| Filename of the PowerShell console file that configured this session. |
| Currently executing command, when in a suspended prompt. |
| Preference that controls how
PowerShell should handle debug output written by a script or
cmdlet. Supports the values |
| Array that holds the (terminating and non-terminating) errors generated in the shell. |
Preference that controls how PowerShell should handle error output written by a script or cmdlet. | |
Supports the values | |
| Preference that controls how
PowerShell should output errors in the shell. Supports the
values of |
| Means by which scripts can access the APIs typically used by cmdlets and providers. |
| Variable that represents the Boolean
value |
| Enumerator within a foreach loop. |
| Limit on how deep into an object the formatting and output facilities travel before outputting an object. |
| User’s home directory |
| Means by which scripts can access the APIs and implementation details of the current host and user interface. |
| Current input pipeline in a pipelined script block. |
| Exit code of the last command—can be explicitly set by scripts, and is automatically set when calling native executables. |
| Preference that tells PowerShell to
log engine health events, such as errors and exceptions.
Supports the values |
| Preference that tells PowerShell to
log engine lifecycle events, such as Start and Stop. Supports
the values |
Preference that tells PowerShell to
log command health events, such as errors and exceptions.
Supports the values | |
| Preference that tells PowerShell to
log command lifecycle events such as Start and Stop. Supports
the values |
| Preference that tells PowerShell to
log provider health events, such as errors and exceptions.
Supports the values |
| Preference that tells PowerShell to
log provider lifecycle events, such as Start and Stop. Supports
the values |
| Limit on how many aliases may be defined. |
| Limit on how many drives may be defined. Does not include default system drives. |
| Limit on how many errors PowerShell
retains in the |
| Limit on how many functions may be defined. |
| Limit on how many history items are retained. |
| Limit on how many variables may be defined. |
| Information about the context under
which the script, function, or script block was run, including
detailed information about the command ( |
| Nesting level of the current prompt.
Incremented by operations that enter a nested prompt (such as
|
| Variable that represents the concept
of |
| Output field separator. Placed between elements when PowerShell outputs a list as a string. |
| Character encoding used when sending pipeline data to external processes. |
| Process ID of the current PowerShell instance. |
| Location and filename of the PowerShell profile for this host. |
| Preference that controls how
PowerShell should handle progress output written by a script or
cmdlet. Supports the values |
| Installation location of PowerShell. |
| Current working directory. |
| Shell identifier of this host. |
| Detailed stack trace information of the last error. |
| Reference to the current object in ScriptMethods and ScriptProperties. |
| Filename used by the Start-Transcript cmdlet. |
| Variable that represents the Boolean
value |
| Preference that tells PowerShell to
output detailed error information when parsing malformed help
files. Supports the values |
| Preference that controls how
PowerShell should handle verbose output written by a script or
cmdlet. Supports the values |
| Preference that controls how
PowerShell should handle warning output written by a script or
cmdlet. Supports the values |
| Preference that controls how
PowerShell should handle confirmation requests called by a
script or cmdlet. Supports the values |
3.21.233.41