File tree Expand file tree Collapse file tree 4 files changed +20
-8
lines changed
5.1/Microsoft.PowerShell.Core/About
7.4/Microsoft.PowerShell.Core/About
7.5/Microsoft.PowerShell.Core/About
7.6/Microsoft.PowerShell.Core/About Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 11---
22description : Explains the concept of scope in PowerShell and shows how to set and change the scope of elements.
33Locale : en-US
4- ms.date : 02/02/2025
4+ ms.date : 01/16/2026
55online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-5.1&WT.mc_id=ps-gethelp
66schema : 2.0.0
77title : about_Scopes
@@ -124,7 +124,10 @@ optional scope modifiers:
124124
125125- ` Global: ` - Specifies that the name exists in the ** Global** scope.
126126- ` Local: ` - Specifies that the name exists in the ** Local** scope. The current
127- scope is always the ** Local** scope.
127+ scope is always the ** Local** scope. When you use the ` Local: ` scope
128+ modifier, PowerShell doesn't search parent scopes. If the item exists in the
129+ current scope, it's used. If the item doesn't exist in the current scope,
130+ PowerShell creates a new item in the current scope.
128131- ` Private: ` - Specifies that the name is ** Private** and only visible to the
129132 current scope.
130133
Original file line number Diff line number Diff line change 11---
22description : Explains the concept of scope in PowerShell and shows how to set and change the scope of elements.
33Locale : en-US
4- ms.date : 02/02/2025
4+ ms.date : 01/16/2026
55online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7.4&WT.mc_id=ps-gethelp
66schema : 2.0.0
77title : about_Scopes
@@ -124,7 +124,10 @@ optional scope modifiers:
124124
125125- ` Global: ` - Specifies that the name exists in the ** Global** scope.
126126- ` Local: ` - Specifies that the name exists in the ** Local** scope. The current
127- scope is always the ** Local** scope.
127+ scope is always the ** Local** scope. When you use the ` Local: ` scope
128+ modifier, PowerShell doesn't search parent scopes. If the item exists in the
129+ current scope, it's used. If the item doesn't exist in the current scope,
130+ PowerShell creates a new item in the current scope.
128131- ` Private: ` - Specifies that the name is ** Private** and only visible to the
129132 current scope.
130133
Original file line number Diff line number Diff line change 11---
22description : Explains the concept of scope in PowerShell and shows how to set and change the scope of elements.
33Locale : en-US
4- ms.date : 02/02/2025
4+ ms.date : 01/16/2026
55online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7.5&WT.mc_id=ps-gethelp
66schema : 2.0.0
77title : about_Scopes
@@ -124,7 +124,10 @@ optional scope modifiers:
124124
125125- ` Global: ` - Specifies that the name exists in the ** Global** scope.
126126- ` Local: ` - Specifies that the name exists in the ** Local** scope. The current
127- scope is always the ** Local** scope.
127+ scope is always the ** Local** scope. When you use the ` Local: ` scope
128+ modifier, PowerShell doesn't search parent scopes. If the item exists in the
129+ current scope, it's used. If the item doesn't exist in the current scope,
130+ PowerShell creates a new item in the current scope.
128131- ` Private: ` - Specifies that the name is ** Private** and only visible to the
129132 current scope.
130133
Original file line number Diff line number Diff line change 11---
22description : Explains the concept of scope in PowerShell and shows how to set and change the scope of elements.
33Locale : en-US
4- ms.date : 02/02/2025
4+ ms.date : 01/16/2026
55online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7.6&WT.mc_id=ps-gethelp
66schema : 2.0.0
77title : about_Scopes
@@ -124,7 +124,10 @@ optional scope modifiers:
124124
125125- ` Global: ` - Specifies that the name exists in the ** Global** scope.
126126- ` Local: ` - Specifies that the name exists in the ** Local** scope. The current
127- scope is always the ** Local** scope.
127+ scope is always the ** Local** scope. When you use the ` Local: ` scope
128+ modifier, PowerShell doesn't search parent scopes. If the item exists in the
129+ current scope, it's used. If the item doesn't exist in the current scope,
130+ PowerShell creates a new item in the current scope.
128131- ` Private: ` - Specifies that the name is ** Private** and only visible to the
129132 current scope.
130133
You can’t perform that action at this time.
0 commit comments