Skip to content

Commit d8b6403

Browse files
authored
Merge pull request #11766 from MicrosoftDocs/main
02/03/2025 PM Publishing
2 parents ae3a0b3 + b9d873e commit d8b6403

Some content is hidden

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

56 files changed

+642
-431
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
22
description: Explains the concept of scope in PowerShell and shows how to set and change the scope of elements.
33
Locale: en-US
4-
ms.date: 07/22/2024
4+
ms.date: 02/02/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-5.1&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Scopes
88
---
99
# about_Scopes
1010

1111
## Short description
12+
1213
Explains the concept of scope in PowerShell and shows how to set and change
1314
the scope of elements.
1415

@@ -32,8 +33,8 @@ The following are the basic rules of scope:
3233
scopes are child scopes of that parent.
3334
- An item is visible in the scope that it was created and in any child scopes,
3435
unless you explicitly make it private.
35-
- You can declare variables, aliases, functions, and PowerShell drives for a
36-
scope outside of the current scope.
36+
- Using scope modifiers, you can declare variables, aliases, functions, and
37+
PowerShell drives for a scope outside of the current scope.
3738
- An item that you created within a scope can be changed only in the scope in
3839
which it was created, unless you explicitly specify a different scope.
3940
- When code running in a runspace references an item, PowerShell searches the
@@ -259,8 +260,7 @@ the following contexts:
259260
**ComputerName**, **HostName**, **SSHConnection** or **Session** parameters
260261
(remote session)
261262
- Background jobs, started with `Start-Job` (out-of-process session)
262-
- Thread jobs, started via `Start-ThreadJob` or `ForEach-Object -Parallel`
263-
(separate thread session)
263+
- Thread jobs, started via `Start-ThreadJob` (separate thread session)
264264

265265
Depending on the context, embedded variable values are either independent
266266
copies of the data in the caller's scope or references to it. In remote and

reference/7.4/Microsoft.PowerShell.Core/About/about_Scopes.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
22
description: Explains the concept of scope in PowerShell and shows how to set and change the scope of elements.
33
Locale: en-US
4-
ms.date: 07/22/2024
4+
ms.date: 02/02/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7.4&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Scopes
88
---
99
# about_Scopes
1010

1111
## Short description
12+
1213
Explains the concept of scope in PowerShell and shows how to set and change
1314
the scope of elements.
1415

@@ -32,8 +33,8 @@ The following are the basic rules of scope:
3233
scopes are child scopes of that parent.
3334
- An item is visible in the scope that it was created and in any child scopes,
3435
unless you explicitly make it private.
35-
- You can declare variables, aliases, functions, and PowerShell drives for a
36-
scope outside of the current scope.
36+
- Using scope modifiers, you can declare variables, aliases, functions, and
37+
PowerShell drives for a scope outside of the current scope.
3738
- An item that you created within a scope can be changed only in the scope in
3839
which it was created, unless you explicitly specify a different scope.
3940
- When code running in a runspace references an item, PowerShell searches the

reference/7.5/Microsoft.PowerShell.Core/About/about_Scopes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Explains the concept of scope in PowerShell and shows how to set and change the scope of elements.
33
Locale: en-US
4-
ms.date: 07/22/2024
4+
ms.date: 02/02/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7.5&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Scopes
@@ -33,8 +33,8 @@ The following are the basic rules of scope:
3333
scopes are child scopes of that parent.
3434
- An item is visible in the scope that it was created and in any child scopes,
3535
unless you explicitly make it private.
36-
- You can declare variables, aliases, functions, and PowerShell drives for a
37-
scope outside of the current scope.
36+
- Using scope modifiers, you can declare variables, aliases, functions, and
37+
PowerShell drives for a scope outside of the current scope.
3838
- An item that you created within a scope can be changed only in the scope in
3939
which it was created, unless you explicitly specify a different scope.
4040
- When code running in a runspace references an item, PowerShell searches the

reference/7.5/Microsoft.PowerShell.Diagnostics/Get-Counter.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ In this example, `Start-Job` runs a `Get-Counter` command as a background job on
171171
To view the performance counter output from the job, use the `Receive-Job` cmdlet.
172172

173173
```powershell
174-
Start-Job -ScriptBlock {Get-Counter -Counter "\LogicalDisk(_Total)\% Free Space" -MaxSamples 1000}
174+
Start-Job -ScriptBlock {
175+
Get-Counter -Counter "\LogicalDisk(_Total)\% Free Space" -MaxSamples 1000
176+
}
175177
```
176178

177179
```Output
@@ -262,7 +264,8 @@ The pipeline is used with the `Where-Object` cmdlet to find a subset of the path
262264
counter sets complete list of counter paths, remove the pipeline (`|`) and `Where-Object` command.
263265

264266
The `$_` is an automatic variable for the current object in the pipeline.
265-
For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md).
267+
For more information, see
268+
[about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md).
266269

267270
```powershell
268271
(Get-Counter -ListSet Memory).Paths | Where-Object { $_ -like "*Cache*" }
@@ -659,4 +662,4 @@ In PowerShell 7, when using the **ListSet** parameter, `Get-Counter` can't retri
659662

660663
[Start-Job](../Microsoft.PowerShell.Core/Start-Job.md)
661664

662-
[Where-Object](..//Microsoft.PowerShell.Core/Where-Object.md)
665+
[Where-Object](../Microsoft.PowerShell.Core/Where-Object.md)

reference/7.5/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ with the asterisk (`*`) wildcard to display each property.
151151

152152
### Example 3: Configure the classic Security log
153153

154-
This command gets an **EventLogConfiguration** object that represents the classic **Security** log. The
155-
object is then used to configure settings for the log, such as max file size, file path, and whether the
156-
log is enabled.
154+
This command gets an **EventLogConfiguration** object that represents the classic **Security** log.
155+
The object is then used to configure settings for the log, such as max file size, file path, and
156+
whether the log is enabled.
157157

158158
```powershell
159159
$log = Get-WinEvent -ListLog Security
@@ -196,17 +196,18 @@ ProviderLatency : 1000
196196
ProviderControlGuid :
197197
```
198198

199-
The `Get-WinEvent` cmdlet uses the **ListLog** parameter to specify the **Security** log. The object is
200-
saved to a variable. The **MaximumSizeInBytes** property is set to 1 gigabyte on the object. The
199+
The `Get-WinEvent` cmdlet uses the **ListLog** parameter to specify the **Security** log. The object
200+
is saved to a variable. The **MaximumSizeInBytes** property is set to 1 gigabyte on the object. The
201201
**SaveChanges** method is called to push the change to the system inside of a try block to handle
202-
access violations. The `Get-WinEvent` cmdlet is called again on the **Security** log and piped to the
203-
`Format-List` cmdlet to verify that the **MaximumSizeInBytes** property has been saved on the machine.
202+
access violations. The `Get-WinEvent` cmdlet is called again on the **Security** log and piped to
203+
the `Format-List` cmdlet to verify that the **MaximumSizeInBytes** property has been saved on the
204+
machine.
204205

205206
### Example 4: Get event logs from a server
206207

207208
This command only gets event logs on the local computer that contain events. It's possible for a
208209
log's **RecordCount** to be null or zero. The example uses the `$_` variable. For more information,
209-
see [about_Automatic_Variables](../Microsoft.PowerShell.Core/about/about_automatic_variables.md).
210+
see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md).
210211

211212
```powershell
212213
Get-WinEvent -ListLog * -ComputerName localhost | Where-Object { $_.RecordCount }
@@ -233,7 +234,8 @@ is a property of the object with a non-null value.
233234

234235
This example gets objects that represent the **Application** event logs on three computers:
235236
Server01, Server02, and Server03. The **ForEach** keyword is used because the **ComputerName**
236-
parameter accepts only one value. For more information, see [about_Foreach](../Microsoft.PowerShell.Core/about/about_Foreach.md).
237+
parameter accepts only one value. For more information, see
238+
[about_Foreach](../Microsoft.PowerShell.Core/About/about_Foreach.md).
237239

238240
```powershell
239241
$S = 'Server01', 'Server02', 'Server03'
@@ -345,7 +347,8 @@ This command lists the Event Ids that the **Microsoft-Windows-GroupPolicy** even
345347
along with the event description.
346348

347349
```powershell
348-
(Get-WinEvent -ListProvider Microsoft-Windows-GroupPolicy).Events | Format-Table Id, Description
350+
(Get-WinEvent -ListProvider Microsoft-Windows-GroupPolicy).Events |
351+
Format-Table Id, Description
349352
```
350353

351354
```Output
@@ -505,7 +508,7 @@ is required.
505508

506509
```powershell
507510
Get-WinEvent -Path 'C:\Tracing\TraceLog.etl' -Oldest |
508-
Sort-Object -Property TimeCreated -Descending |
511+
Sort-Object -Property TimeCreated -Descending |
509512
Select-Object -First 100
510513
```
511514

@@ -526,7 +529,7 @@ reading from an `.etl` file, but the **Oldest** parameter applies to each file.
526529

527530
```powershell
528531
Get-WinEvent -Path 'C:\Tracing\TraceLog.etl', 'C:\Test\Windows PowerShell.evtx' -Oldest |
529-
Where-Object { $_.Id -eq '403' }
532+
Where-Object { $_.Id -eq '403' }
530533
```
531534

532535
The `Get-WinEvent` cmdlet gets log information from the archived files. The **Path** parameter uses
@@ -573,8 +576,9 @@ Get-WinEvent -LogName 'Windows PowerShell' -FilterXPath $XPath
573576

574577
This example uses the **FilterHashtable** parameter to get events from the **Application** log. The
575578
hash table uses **key/value** pairs. For more information about the **FilterHashtable** parameter,
576-
see [Creating Get-WinEvent queries with FilterHashtable](/powershell/scripting/samples/Creating-Get-WinEvent-queries-with-FilterHashtable).
577-
For more information about hash tables, see [about_Hash_Tables](../Microsoft.PowerShell.Core/about/about_hash_tables.md).
579+
see [Creating Get-WinEvent queries with FilterHashtable](/powershell/scripting/samples/creating-get-winevent-queries-with-filterhashtable).
580+
For more information about hash tables, see
581+
[about_Hash_Tables](../Microsoft.PowerShell.Core/About/about_Hash_Tables.md).
578582

579583
```powershell
580584
$Date = (Get-Date).AddDays(-2)
@@ -739,8 +743,9 @@ Help.
739743

740744
Use an XML query to create a complex query that contains several XPath statements. The XML format
741745
also allows you to use a **Suppress XML** element that excludes events from the query. For more
742-
information about the XML schema for event log queries, see [Query Schema](/windows/win32/wes/queryschema-schema)
743-
and the XML Event Queries section of [Event Selection](/previous-versions/aa385231(v=vs.85)).
746+
information about the XML schema for event log queries, see
747+
[Query Schema](/windows/win32/wes/queryschema-schema) and the XML Event Queries section of
748+
[Event Selection](/previous-versions/aa385231(v=vs.85)).
744749

745750
You may also create a **Suppress** element using the **FilterHashtable** parameter.
746751

@@ -760,7 +765,8 @@ Accept wildcard characters: False
760765

761766
Specifies an XPath query that this cmdlet select events from one or more logs.
762767

763-
For more information about the XPath language, see [XPath Reference](/previous-versions/dotnet/netframework-4.0/ms256115(v=vs.100))
768+
For more information about the XPath language, see
769+
[XPath Reference](/previous-versions/dotnet/netframework-4.0/ms256115(v=vs.100))
764770
and the Selection Filters section of [Event Selection](/previous-versions/aa385231(v=vs.85)).
765771

766772
```yaml
@@ -841,8 +847,8 @@ cmdlet.
841847
> [!NOTE]
842848
> PowerShell does not limit the amount of logs you can request. However, the `Get-WinEvent` cmdlet
843849
> queries the Windows API which has a limit of 256. This can make it difficult to filter through all
844-
> of your logs at one time. You can work around this by using a `foreach` loop to iterate through each
845-
> log like this: `Get-WinEvent -ListLog * | ForEach-Object{ Get-WinEvent -LogName $_.LogName }`
850+
> of your logs at one time. You can work around this by using a `foreach` loop to iterate through
851+
> each log like this: `Get-WinEvent -ListLog * | ForEach-Object{ Get-WinEvent -LogName $_.LogName }`
846852

847853
```yaml
848854
Type: System.String[]
@@ -939,7 +945,8 @@ Accept wildcard characters: True
939945

940946
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
941947
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
942-
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
948+
-WarningAction, and -WarningVariable. For more information, see
949+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
943950

944951
## INPUTS
945952

@@ -980,13 +987,13 @@ Environment (Windows PE).
980987

981988
## RELATED LINKS
982989

983-
[about_Automatic_Variables](../Microsoft.PowerShell.Core/about/about_automatic_variables.md)
990+
[about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md)
984991

985-
[about_Foreach](../Microsoft.PowerShell.Core/about/about_Foreach.md)
992+
[about_Foreach](../Microsoft.PowerShell.Core/About/about_Foreach.md)
986993

987-
[about_Hash_Tables](../Microsoft.PowerShell.Core/about/about_hash_tables.md)
994+
[about_Hash_Tables](../Microsoft.PowerShell.Core/About/about_Hash_Tables.md)
988995

989-
[Creating Get-WinEvent queries with FilterHashtable](/powershell/scripting/samples/Creating-Get-WinEvent-queries-with-FilterHashtable)
996+
[Creating Get-WinEvent queries with FilterHashtable](/powershell/scripting/samples/creating-get-winevent-queries-with-filterhashtable)
990997

991998
[Format-Table](../Microsoft.PowerShell.Utility/Format-Table.md)
992999

reference/7.5/Microsoft.PowerShell.Management/Add-Content.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ set to `False`.
159159
### Example 7: Use Filters with Add-Content
160160

161161
You can specify a filter to the `Add-Content` cmdlet. When using filters to qualify the **Path**
162-
parameter, you need to include a trailing asterisk (`*`) to indicate the contents of the
163-
path.
162+
parameter, you need to include a trailing asterisk (`*`) to indicate the contents of the path.
164163

165164
The following command adds the word "Done" the content of all `*.txt` files in the `C:\Temp`
166165
directory.
@@ -235,7 +234,7 @@ The acceptable values for this parameter are as follows:
235234
Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code
236235
pages (like `-Encoding 1251`) or string names of registered code pages (like
237236
`-Encoding "windows-1251"`). For more information, see the .NET documentation for
238-
[Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2).
237+
[Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A).
239238

240239
Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass
241240
the numeric ID for the current culture's ANSI code page without having to specify it manually.
@@ -429,8 +428,8 @@ You can use the `Add-Content` cmdlet to change the content of any alternate data
429428
block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use
430429
the `Unblock-File` cmdlet.
431430

432-
This parameter was introduced in PowerShell 3.0. As of PowerShell 7.2, `Add-Content` can
433-
target alternative data streams on both files and directories.
431+
This parameter was introduced in PowerShell 3.0. As of PowerShell 7.2, `Add-Content` can target
432+
alternative data streams on both files and directories.
434433

435434
```yaml
436435
Type: System.String

reference/7.5/Microsoft.PowerShell.Management/Clear-Item.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ Clears the contents of an item, but does not delete the item.
1818
### Path (Default)
1919

2020
```
21-
Clear-Item [-Path] <String[]> [-Force] [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>]
22-
[-Credential <PSCredential>] [-WhatIf] [-Confirm] [<CommonParameters>]
21+
Clear-Item [-Path] <String[]> [-Force] [-Filter <String>] [-Include <String[]>]
22+
[-Exclude <String[]>] [-Credential <PSCredential>] [-WhatIf] [-Confirm] [<CommonParameters>]
2323
```
2424

2525
### LiteralPath
2626

2727
```
28-
Clear-Item -LiteralPath <String[]> [-Force] [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>]
29-
[-Credential <PSCredential>] [-WhatIf] [-Confirm] [<CommonParameters>]
28+
Clear-Item -LiteralPath <String[]> [-Force] [-Filter <String>] [-Include <String[]>]
29+
[-Exclude <String[]>] [-Credential <PSCredential>] [-WhatIf] [-Confirm] [<CommonParameters>]
3030
```
3131

3232
## DESCRIPTION
@@ -180,7 +180,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c
180180
it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters
181181
as escape sequences.
182182

183-
For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md).
183+
For more information, see
184+
[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md).
184185

185186
```yaml
186187
Type: System.String[]
@@ -247,10 +248,10 @@ Accept wildcard characters: False
247248

248249
### CommonParameters
249250

250-
This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVariable`,
251-
`-InformationAction`, `-InformationVariable`, `-OutVariable`, `-OutBuffer`, `-PipelineVariable`,
252-
`-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see
253-
[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md).
251+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
252+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
253+
-WarningAction, and -WarningVariable. For more information, see
254+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
254255

255256
## INPUTS
256257

reference/7.5/Microsoft.PowerShell.Management/Clear-ItemProperty.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,13 @@ Accept wildcard characters: True
9090

9191
### -Filter
9292

93-
Specifies a filter to qualify the **Path** parameter. The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md)
94-
provider is the only installed PowerShell provider that supports the use of filters. You can find
95-
the syntax for the **FileSystem** filter language in [about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md).
96-
Filters are more efficient than other parameters, because the provider applies them when the cmdlet
97-
gets the objects rather than having PowerShell filter the objects after they are retrieved.
93+
Specifies a filter to qualify the **Path** parameter. The
94+
[FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the only
95+
installed PowerShell provider that supports the use of filters. You can find the syntax for the
96+
**FileSystem** filter language in
97+
[about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). Filters are more efficient
98+
than other parameters, because the provider applies them when the cmdlet gets the objects rather
99+
than having PowerShell filter the objects after they are retrieved.
98100

99101
```yaml
100102
Type: System.String
@@ -153,7 +155,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c
153155
it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters
154156
as escape sequences.
155157

156-
For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md).
158+
For more information, see
159+
[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md).
157160

158161
```yaml
159162
Type: System.String[]
@@ -253,10 +256,10 @@ Accept wildcard characters: False
253256

254257
### CommonParameters
255258

256-
This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVariable`,
257-
`-InformationAction`, `-InformationVariable`, `-OutVariable`, `-OutBuffer`, `-PipelineVariable`,
258-
`-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see
259-
[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md).
259+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
260+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
261+
-WarningAction, and -WarningVariable. For more information, see
262+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
260263

261264
## INPUTS
262265

0 commit comments

Comments
 (0)