11---
22description : Describes variables that store state information for PowerShell. These variables are created and maintained by PowerShell.
33Locale : en-US
4- ms.date : 01/07/2025
4+ ms.date : 01/18/2026
55no-loc : [Reset, Current, Background, Blink, Bold, Foreground, Formatting, Hidden, Italic, Reset, Reverse, Underline, PSEventArgs, PSEventSubscriber, PSEdition]
66online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-5.1&WT.mc_id=ps-gethelp
77schema : 2.0.0
88title : about_Automatic_Variables
99---
10-
1110# about_Automatic_Variables
1211
1312## Short description
@@ -135,7 +134,7 @@ For more information, see [about_PSItem][67].
135134### ` $args `
136135
137136Contains 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
137+ function, script, or scriptblock . When you create a function, you can declare
139138the parameters with the ` param ` keyword or by adding a comma-separated list of
140139parameters in parentheses after the function name.
141140
@@ -172,7 +171,7 @@ processed. This variable is populated only within the `Action` block of an
172171event registration command, such as ` Register-ObjectEvent ` . The value of this
173172variable is the same object that the ` Get-Event ` cmdlet returns. You can use
174173the properties of the ` Event ` variable, such as ` $Event.TimeGenerated ` , in an
175- ` Action ` script block .
174+ ` Action ` scriptblock .
176175
177176### ` $EventArgs `
178177
@@ -232,8 +231,8 @@ display or change the properties of the host, such as `$Host.Version` or
232231### ` $input `
233232
234233Contains 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 ).
234+ The ` $input ` variable is available only to functions, scriptblocks (which
235+ are unnamed functions), and script files (which are saved scriptblocks ).
237236
238237- In a function without a ` begin ` , ` process ` , or ` end ` block, the ` $input `
239238 variable enumerates the collection of all input to the function.
@@ -248,7 +247,7 @@ are unnamed functions), and script files (which are saved script blocks).
248247
249248 > [ !NOTE]
250249 > You can't use the ` $input ` variable inside both the ` process ` block and the
251- > ` end ` block in the same function or script block .
250+ > ` end ` block in the same function or scriptblock .
252251
253252Since ` $input ` is an enumerator, accessing any of its properties causes
254253` $input ` to no longer be available. You can store ` $input ` in another variable
@@ -336,7 +335,7 @@ Contains information about the current command, such as the name, parameters,
336335parameter values, and information about how the command was started, called, or
337336invoked, such as the name of the script that called the current command.
338337
339- ` $MyInvocation ` is populated only for scripts, function, and script blocks . You
338+ ` $MyInvocation ` is populated only for scripts, function, and scriptblocks . You
340339can use the information in the ** System.Management.Automation.InvocationInfo**
341340object that ` $MyInvocation ` returns in the current script, such as the name of
342341a function (` $MyInvocation.MyCommand.Name ` ) to identify the current command.
@@ -650,11 +649,11 @@ and change the current loop iteration. For more information, see
650649
651650### ` $this `
652651
653- The ` $this ` variable is used in script blocks that extend classes to refer to
652+ The ` $this ` variable is used in scriptblocks that extend classes to refer to
654653the instance of the class itself.
655654
656655PowerShell'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
656+ classes using scriptblocks . In a scriptblock that defines a script property
658657or script method, the ` $this ` variable refers to an instance of object of the
659658class that's being extended. For example, PowerShell uses ETS to add the
660659** BaseName** property to the ** FileInfo** class.
@@ -676,7 +675,7 @@ In a PowerShell class, the `$this` variable refers to the instance object of
676675the class itself, allowing access to properties and methods defined in the
677676class. For more information, see [ about_Classes] [ 52 ] .
678677
679- The ` $this ` variable is also used by .NET event classes that take script blocks
678+ The ` $this ` variable is also used by .NET event classes that take scriptblocks
680679as delegates for the event handler. In this scenario, ` $this ` represents the
681680object originating the event, known as the event sender.
682681
@@ -1115,3 +1114,6 @@ Default (Current): End
11151114[ 75 ] : xref:System.Collections.IEnumerator.Current
11161115[ 76 ] : xref:System.Collections.IEnumerator.MoveNext
11171116[ 77 ] : xref:System.Collections.IEnumerator.Reset
1117+
1118+
1119+
0 commit comments