Skip to content

Commit 918194e

Browse files
authored
Fixes #12608 - Standardize scriptblock and statement terminology (#12673)
* Standardize scriptblock and statement terminology * Fix build errors and warnings * fix build
1 parent ca6df6b commit 918194e

File tree

359 files changed

+2682
-2564
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

359 files changed

+2682
-2564
lines changed

reference/5.1/CimCmdlets/Register-CimIndicationEvent.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.Management.Infrastructure.CimCmdlets.dll-Help.xml
33
Locale: en-US
44
Module Name: CimCmdlets
5-
ms.date: 01/16/2026
5+
ms.date: 01/18/2026
66
no-loc: [-Forward]
77
online version: https://learn.microsoft.com/powershell/module/cimcmdlets/register-cimindicationevent?view=powershell-5.1&WT.mc_id=ps-gethelp
88
schema: 2.0.0
@@ -96,7 +96,7 @@ Register-CimIndicationEvent -Query $query -SourceIdentifier "Timer"
9696
### Example 3: Run a script when the event arrives
9797

9898
This example shows how to use an action in response to an event. The variable `$action` holds the
99-
script block for **Action**, which uses the `$Event` variable to access the event received from CIM.
99+
scriptblock for **Action**, which uses the `$Event` variable to access the event received from CIM.
100100

101101
```powershell
102102
$action = {
@@ -137,11 +137,11 @@ Get-Event -SourceIdentifier "ProcessStarted"
137137

138138
Specifies the commands that handle the events. The commands specified by this parameter run when an
139139
event is raised, instead of sending the event to the event queue. Enclose the commands in braces
140-
(`{}`) to create a script block.
140+
(`{}`) to create a scriptblock.
141141

142-
The script block specified with **Action** can include the `$Event`, `$EventSubscriber`, `$Sender`,
142+
The scriptblock specified with **Action** can include the `$Event`, `$EventSubscriber`, `$Sender`,
143143
`$SourceEventArgs`, and `$SourceArgs` automatic variables, which provide information about the event
144-
to the **Action** script block. For more information, see
144+
to the **Action** scriptblock. For more information, see
145145
[About Automatic Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md).
146146

147147
```yaml
@@ -419,3 +419,4 @@ This cmdlet returns an **EventSubscription** object.
419419
[New-CimSession](New-CimSession.md)
420420

421421
[about_WQL](../Microsoft.PowerShell.Core/About/about_WQL.md)
422+

reference/5.1/Microsoft.PowerShell.Core/About/About.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: About topics cover a range of concepts about PowerShell.
33
Help Version: 6.0
44
Locale: en-US
5-
ms.date: 04/01/2025
5+
ms.date: 01/18/2026
66
title: About topics
77
---
88
# About topics
@@ -496,7 +496,7 @@ special meaning in PowerShell.
496496

497497
### [about_Return](about_Return.md)
498498

499-
Exits the current scope, which can be a function, script, or script block.
499+
Exits the current scope, which can be a function, script, or scriptblock.
500500

501501
### [about_Run_With_PowerShell](about_Run_With_PowerShell.md)
502502

@@ -510,7 +510,7 @@ scope of elements.
510510

511511
### [about_Script_Blocks](about_Script_Blocks.md)
512512

513-
Defines what a script block is and explains how to use script blocks in the
513+
Defines what a scriptblock is and explains how to use scriptblocks in the
514514
PowerShell programming language.
515515

516516
### [about_Script_Internationalization](about_Script_Internationalization.md)
@@ -655,3 +655,6 @@ manageable components of the modern enterprise.
655655

656656
Describes WMI Query Language (WQL), which can be used to get WMI objects in
657657
Windows PowerShell.
658+
659+
660+

reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes arrays, which are data structures designed to store collections of items.
33
Locale: en-US
4-
ms.date: 01/03/2025
4+
ms.date: 01/18/2026
55
no-loc: [Count, Length, LongLength, Rank, ForEach, Clear, Default, First, Last, SkipUntil, Until, Split, Tuple]
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_arrays?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
@@ -522,7 +522,7 @@ ForEach(string methodName, object[] arguments)
522522
This method was added in PowerShell v4.
523523

524524
> [!NOTE]
525-
> The syntax requires the usage of a script block. Parentheses are optional if
525+
> The syntax requires the usage of a scriptblock. Parentheses are optional if
526526
> the scriptblock is the only parameter. Also, there must not be a space
527527
> between the method and the opening parenthesis or brace.
528528
@@ -542,7 +542,7 @@ $a.ForEach({ $_ * $_})
542542
```
543543

544544
Just like the **ArgumentList** parameter of `ForEach-Object`, the `arguments`
545-
parameter allows the passing of an array of arguments to a script block
545+
parameter allows the passing of an array of arguments to a scriptblock
546546
configured to accept them.
547547

548548
For more information about the behavior of **ArgumentList**, see
@@ -601,7 +601,7 @@ THREE
601601
```
602602

603603
Just like the **ArgumentList** parameter of `ForEach-Object`, the `arguments`
604-
parameter allows the passing of an array of values to a script block configured
604+
parameter allows the passing of an array of values to a scriptblock configured
605605
to accept them.
606606

607607
> [!NOTE]
@@ -625,7 +625,7 @@ Where(scriptblock expression[, WhereOperatorSelectionMode mode
625625
```
626626

627627
> [!NOTE]
628-
> The syntax requires the usage of a script block. Parentheses are optional if
628+
> The syntax requires the usage of a scriptblock. Parentheses are optional if
629629
> the scriptblock is the only parameter. Also, there must not be a space
630630
> between the method and the opening parenthesis or brace.
631631
@@ -701,7 +701,7 @@ $logs.Where({$_.CreationTime -gt $h}, 'Last', 5)
701701
#### SkipUntil
702702

703703
The `SkipUntil` mode skips all objects in a collection until an object passes
704-
the script block expression filter. It then returns **ALL** remaining
704+
the scriptblock expression filter. It then returns **ALL** remaining
705705
collection items without testing them. _Only one passing item is tested_.
706706

707707
This means the returned collection contains both _passing_ and
@@ -723,7 +723,7 @@ localhost
723723
#### Until
724724

725725
The `Until` mode inverts the `SkipUntil` mode. It returns **ALL** items in a
726-
collection until an item passes the script block expression. Once an item
726+
collection until an item passes the scriptblock expression. Once an item
727727
_passes_ the scriptblock expression, the `Where()` method stops processing
728728
items.
729729

@@ -1115,3 +1115,6 @@ LastWriteTimeUtc Property datetime LastWriteTimeUtc {get;set;}
11151115
[12]: about_Splatting.md#splatting-with-arrays
11161116
[13]: about_While.md
11171117
[14]: https://wikipedia.org/wiki/Row-_and_column-major_order
1118+
1119+
1120+

reference/5.1/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
description: Describes variables that store state information for PowerShell. These variables are created and maintained by PowerShell.
33
Locale: en-US
4-
ms.date: 01/07/2025
4+
ms.date: 01/18/2026
55
no-loc: [Reset, Current, Background, Blink, Bold, Foreground, Formatting, Hidden, Italic, Reset, Reverse, Underline, PSEventArgs, PSEventSubscriber, PSEdition]
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: 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

137136
Contains 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
139138
the parameters with the `param` keyword or by adding a comma-separated list of
140139
parameters in parentheses after the function name.
141140

@@ -172,7 +171,7 @@ processed. This variable is populated only within the `Action` block of an
172171
event registration command, such as `Register-ObjectEvent`. The value of this
173172
variable is the same object that the `Get-Event` cmdlet returns. You can use
174173
the 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

234233
Contains 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
253252
Since `$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,
336335
parameter values, and information about how the command was started, called, or
337336
invoked, 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
340339
can use the information in the **System.Management.Automation.InvocationInfo**
341340
object that `$MyInvocation` returns in the current script, such as the name of
342341
a 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
654653
the instance of the class itself.
655654

656655
PowerShell'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
658657
or script method, the `$this` variable refers to an instance of object of the
659658
class 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
676675
the class itself, allowing access to properties and methods defined in the
677676
class. 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
680679
as delegates for the event handler. In this scenario, `$this` represents the
681680
object 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+

reference/5.1/Microsoft.PowerShell.Core/About/about_Break.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes a statement you can use to immediately exit `foreach`, `for`, `while`, `do`, `switch`, or `trap` statements.
33
Locale: en-US
4-
ms.date: 04/29/2025
4+
ms.date: 01/18/2026
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_break?view=powershell-5.1&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Break
@@ -219,8 +219,8 @@ This means that functions and scripts that inadvertently use a `break` outside
219219
of an enclosing construct that supports it can inadvertently terminate their
220220
_callers_.
221221

222-
Using `break` inside a pipeline `break`, such as a `ForEach-Object` script
223-
block, not only exits the pipeline, it potentially terminates the entire
222+
Using `break` inside a pipeline `break`, such as a `ForEach-Object`
223+
scriptblock, not only exits the pipeline, it potentially terminates the entire
224224
runspace.
225225

226226
## See also
@@ -234,3 +234,4 @@ runspace.
234234
- [about_Trap](about_Trap.md)
235235
- [about_Try_Catch_Finally](about_Try_Catch_Finally.md)
236236
- [about_While](about_While.md)
237+

reference/5.1/Microsoft.PowerShell.Core/About/about_Calculated_Properties.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: PowerShell provides the ability to dynamically add new properties and alter the formatting of objects output to the pipeline.
33
Locale: en-US
4-
ms.date: 01/13/2026
4+
ms.date: 01/18/2026
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_calculated_properties?view=powershell-5.1&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Calculated_Properties
@@ -72,7 +72,7 @@ the key-value pairs that each cmdlet supports.
7272
- `Expression`
7373

7474
- `Measure-Object`
75-
- Only supports a script block for the expression, not a hashtable.
75+
- Only supports a scriptblock for the expression, not a hashtable.
7676
- Not supported in PowerShell 5.1 and older.
7777

7878
- `Select-Object`
@@ -84,14 +84,14 @@ the key-value pairs that each cmdlet supports.
8484
- `Ascending`/`Descending` - optional
8585

8686
> [!NOTE]
87-
> The value of the `Expression` can be a script block instead of a
87+
> The value of the `Expression` can be a scriptblock instead of a
8888
> hashtable. For more information, see the [Notes][02] section.
8989
9090
## Hashtable key definitions
9191

9292
- `Name`/`Label` - Specifies the name of the property being created. You can
9393
use `Name` or its alias, `Label`, interchangeably.
94-
- `Expression` - A string or script block used to calculate the value of the
94+
- `Expression` - A string or scriptblock used to calculate the value of the
9595
new property. If the `Expression` is a string, the value is interpreted as a
9696
property name on the input object. This is a shorter option than
9797
`Expression = { $_.<PropertyName> }`.
@@ -449,7 +449,7 @@ Date Salesperson UnitsSold
449449

450450
## Notes
451451

452-
- You may specify the expression script block _directly_, as an argument,
452+
- You may specify the expression scriptblock _directly_, as an argument,
453453
rather than specifying it as the `Expression` entry in a hashtable. For
454454
example:
455455

@@ -461,17 +461,17 @@ Date Salesperson UnitsSold
461461
naming a property via the `Name` key, such as `Sort-Object`, `Group-Object`,
462462
and `Measure-Object`.
463463

464-
For cmdlets that support naming the property, the script block is converted
464+
For cmdlets that support naming the property, the scriptblock is converted
465465
to a string and used as the name of the property in the output.
466466

467-
- `Expression` script blocks run in _child_ scopes, meaning that the caller's
467+
- `Expression` scriptblocks run in _child_ scopes, meaning that the caller's
468468
variables can't be directly modified.
469469

470-
- Pipeline logic is applied to the output from `Expression` script blocks. This
470+
- Pipeline logic is applied to the output from `Expression` scriptblocks. This
471471
means that outputting a single-element array causes that array to be
472472
unwrapped.
473473

474-
- For most cmdlets, errors inside expression script blocks are quietly ignored.
474+
- For most cmdlets, errors inside expression scriptblocks are quietly ignored.
475475
For `Sort-Object`, statement-terminating and script-terminating errors are
476476
_output_ but they don't terminate the statement.
477477

@@ -504,3 +504,4 @@ Date Salesperson UnitsSold
504504
[11]: xref:Microsoft.PowerShell.Utility.Measure-Object
505505
[12]: xref:Microsoft.PowerShell.Utility.Select-Object
506506
[13]: xref:Microsoft.PowerShell.Utility.Sort-Object
507+

reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes how PowerShell determines which command to run.
33
Locale: en-US
4-
ms.date: 03/05/2024
4+
ms.date: 01/18/2026
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-5.1&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Command_Precedence
@@ -225,7 +225,7 @@ You can also use the call operator (`&`) to run hidden commands by combining it
225225
with a call to [Get-ChildItem][13] (the alias is `dir`), `Get-Command` or
226226
[Get-Module][11].
227227

228-
The call operator executes strings and script blocks in a child scope. For more
228+
The call operator executes strings and scriptblocks in a child scope. For more
229229
information, see [about_Operators][08].
230230

231231
For example, use the following command to run the function named `Map` that's
@@ -341,3 +341,4 @@ you must add the extension to the `$Env:PATHEXT` environment variable.
341341
[13]: xref:Microsoft.PowerShell.Management.Get-ChildItem
342342
[14]: xref:Microsoft.PowerShell.Utility.Get-Date
343343
[15]: xref:Microsoft.PowerShell.Utility.Import-PSSession
344+

reference/5.1/Microsoft.PowerShell.Core/About/about_CommonParameters.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes the parameters that can be used with any cmdlet.
33
Locale: en-US
4-
ms.date: 01/12/2026
4+
ms.date: 01/18/2026
55
no-loc: [Confirm, Debug, ErrorAction, ErrorVariable, InformationAction, InformationVariable, OutBuffer, OutVariable, PipelineVariable, ProgressAction, Verbose, WarningAction, WarningVariable, WhatIf]
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
@@ -384,9 +384,9 @@ piped from while processing the next item passing through the pipeline. This
384384
allows a command to _feed back_ its output to a previous command (or itself).
385385

386386
>[!NOTE]
387-
> Advanced functions can have up to three script blocks: `begin`, `process`,
387+
> Advanced functions can have up to three scriptblocks: `begin`, `process`,
388388
> and `end`. When using the `PipelineVariable` parameter with advanced
389-
> functions, only values from the first defined script block are assigned to
389+
> functions, only values from the first defined scriptblock are assigned to
390390
> the variable as the function runs. For more information, see
391391
> [Advanced functions][05]. PowerShell 7.2 corrects this behavior.
392392

@@ -844,3 +844,4 @@ Mode LastWriteTime Length Name
844844
[12]: xref:Microsoft.PowerShell.Utility.Write-Error
845845
[13]: xref:Microsoft.PowerShell.Utility.Write-Verbose
846846
[14]: xref:Microsoft.PowerShell.Utility.Write-Warning
847+

reference/5.1/Microsoft.PowerShell.Core/About/about_Comparison_Operators.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes the operators that compare values in PowerShell.
33
Locale: en-US
4-
ms.date: 06/20/2025
4+
ms.date: 01/18/2026
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comparison_operators?view=powershell-5.1&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Comparison_Operators
@@ -780,3 +780,4 @@ $a -isnot $b.GetType() # Output: True
780780
[13]: xref:Microsoft.PowerShell.Core.Where-Object
781781
[14]: xref:Microsoft.PowerShell.Utility.Compare-Object
782782
[15]: /powershell/scripting/learn/glossary#scalar-value
783+

0 commit comments

Comments
 (0)