11---
2- description : Describes variables that store state information for PowerShell. These variables are created and maintained by PowerShell.
3- Locale : en-US
4- ms.date : 01/07/2025
5- no-loc : [Reset, Current, Background, Blink, Bold, Foreground, Formatting, Hidden, Italic, Reset, Reverse, Underline, PSEventArgs, PSEventSubscriber, PSEdition]
6- online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-5.1&WT.mc_id=ps-gethelp
7- schema : 2.0.0
8- title : about_Automatic_Variables
2+ ms.date : 01/18/2026
93---
10-
114# about_Automatic_Variables
125
136## Short description
@@ -135,7 +128,7 @@ For more information, see [about_PSItem][67].
135128### ` $args `
136129
137130Contains an array of values for undeclared parameters that are passed to a
138- function, script, or script block . When you create a function, you can declare
131+ function, script, or scriptblock . When you create a function, you can declare
139132the parameters with the ` param ` keyword or by adding a comma-separated list of
140133parameters in parentheses after the function name.
141134
@@ -172,7 +165,7 @@ processed. This variable is populated only within the `Action` block of an
172165event registration command, such as ` Register-ObjectEvent ` . The value of this
173166variable is the same object that the ` Get-Event ` cmdlet returns. You can use
174167the properties of the ` Event ` variable, such as ` $Event.TimeGenerated ` , in an
175- ` Action ` script block .
168+ ` Action ` scriptblock .
176169
177170### ` $EventArgs `
178171
@@ -232,8 +225,8 @@ display or change the properties of the host, such as `$Host.Version` or
232225### ` $input `
233226
234227Contains an enumerator that enumerates all input that's passed to a function.
235- The ` $input ` variable is available only to functions, script blocks (which
236- are unnamed functions), and script files (which are saved script blocks ).
228+ The ` $input ` variable is available only to functions, scriptblocks (which
229+ are unnamed functions), and script files (which are saved scriptblocks ).
237230
238231- In a function without a ` begin ` , ` process ` , or ` end ` block, the ` $input `
239232 variable enumerates the collection of all input to the function.
@@ -248,7 +241,7 @@ are unnamed functions), and script files (which are saved script blocks).
248241
249242 > [ !NOTE]
250243 > You can't use the ` $input ` variable inside both the ` process ` block and the
251- > ` end ` block in the same function or script block .
244+ > ` end ` block in the same function or scriptblock .
252245
253246Since ` $input ` is an enumerator, accessing any of its properties causes
254247` $input ` to no longer be available. You can store ` $input ` in another variable
@@ -336,7 +329,7 @@ Contains information about the current command, such as the name, parameters,
336329parameter values, and information about how the command was started, called, or
337330invoked, such as the name of the script that called the current command.
338331
339- ` $MyInvocation ` is populated only for scripts, function, and script blocks . You
332+ ` $MyInvocation ` is populated only for scripts, function, and scriptblocks . You
340333can use the information in the ** System.Management.Automation.InvocationInfo**
341334object that ` $MyInvocation ` returns in the current script, such as the name of
342335a function (` $MyInvocation.MyCommand.Name ` ) to identify the current command.
@@ -650,11 +643,11 @@ and change the current loop iteration. For more information, see
650643
651644### ` $this `
652645
653- The ` $this ` variable is used in script blocks that extend classes to refer to
646+ The ` $this ` variable is used in scriptblocks that extend classes to refer to
654647the instance of the class itself.
655648
656649PowerShell's Extensible Type System (ETS) allows you to add properties to
657- classes using script blocks . In a script block that defines a script property
650+ classes using scriptblocks . In a scriptblock that defines a script property
658651or script method, the ` $this ` variable refers to an instance of object of the
659652class that's being extended. For example, PowerShell uses ETS to add the
660653** BaseName** property to the ** FileInfo** class.
@@ -676,7 +669,7 @@ In a PowerShell class, the `$this` variable refers to the instance object of
676669the class itself, allowing access to properties and methods defined in the
677670class. For more information, see [ about_Classes] [ 52 ] .
678671
679- The ` $this ` variable is also used by .NET event classes that take script blocks
672+ The ` $this ` variable is also used by .NET event classes that take scriptblocks
680673as delegates for the event handler. In this scenario, ` $this ` represents the
681674object originating the event, known as the event sender.
682675
@@ -1115,3 +1108,6 @@ Default (Current): End
11151108[ 75 ] : xref:System.Collections.IEnumerator.Current
11161109[ 76 ] : xref:System.Collections.IEnumerator.MoveNext
11171110[ 77 ] : xref:System.Collections.IEnumerator.Reset
1111+
1112+
1113+
0 commit comments