Updates from: 02/01/2022 03:03:53
Service Microsoft Docs article Related commit history on GitHub Change details
Microsoft.PowerShell.Core About Scopes (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Core/About/about_Scopes.md
--- description: Explains the concept of scope in PowerShell and shows how to set and change the scope of elements. Locale: en-US Previously updated : 10/22/2021 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Scopes
The following are the basic rules of scope:
scopes are child scopes of that parent. - An item is visible in the scope in which it was created and in any child
- scopes, unless you explicitly make it private. You can place variables,
- aliases, functions, or PowerShell drives in one or more scopes.
+ scopes, unless you explicitly make it private.
+
+- You can declare variables, aliases, functions, and PowerShell drives in a
+ scope outside of the current scope.
- An item that you created within a scope can be changed only in the scope in which it was created, unless you explicitly specify a different scope.
Microsoft.PowerShell.Core Enter Pshostprocess (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Core/Enter-PSHostProcess.md
external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core Previously updated : 06/09/2017
-online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/enter-pshostprocess?view=powershell-5.1&WT.mc_id=ps-gethelp
Last updated : 01/31/2022
+online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/enter-pshostprocess?view=powershell-7.1&WT.mc_id=ps-gethelp
schema: 2.0.0 Title: Enter-PSHostProcess ---
session.
## Examples
-### Example 1: Start debugging a runspace within the PowerShell ISE process
+### Example Part 1: Start debugging a runspace within the PowerShell ISE process
In this example, you run `Enter-PSHostProcess` from within the PowerShell console to enter the PowerShell ISE process. In the resulting interactive session, you can find a runspace that you want
to debug by running `Get-Runspace`, and then debug the runspace.
``` PS C:\> Enter-PSHostProcess -Name powershell_ise
-[Process:1520]: PS C:\Test\Documents>
-
-Next, get available runspaces within the process you have entered.
-PS C:\> [Process:1520]: PS C:\> Get-Runspace
+[Process:1520]: PS C:\> Get-Runspace
Id Name InstanceId State Availability -- ------- ----------- ------ ------------- 1 Runspace1 2d91211d-9cce-42f0-ab0e-71ac258b32b5 Opened Available
Id Name InstanceId State Ava
3 MyLocalRS 2236dbd8-2105-4dec-a15a-a27d0bfaacb5 Opened LocalDebug 4 MyRunspace 771356e9-8c44-4b70-9de5-dd17cb41e48e Opened Busy 5 Runspace8 3e517382-a97a-49ba-9c3c-fd21f6664288 Broken None
+```
+
+### Example part 2: Debug a specific runspace
-The runspace objects returned by Get-Runspace also have a NoteProperty called ScriptStackTrace of
-the running command stack, if available.Next, debug runspace ID 4, that is running another user's
-long-running script. From the list returned from Get-Runspace, note that the runspace state is
-Opened, and Availability is Busy, meaning that the runspace is still running the long-running
-script.
+Next, debug runspace ID 4, that is running another user's long-running script. From the list
+returned from `Get-Runspace`, note that the runspace **State** is Opened, and **Availability** is
+Busy, meaning that the runspace is still running the long-running script. The runspace objects
+returned by `Get-Runspace` also have a **NoteProperty** called **ScriptStackTrace** of the running
+command stack, if available.
-PS C:\> [Process:1520]: PS C:\> (Get-Runspace -Id 4).ScriptStackTrace
+```
+[Process:1520]: PS C:\> (Get-Runspace -Id 4).ScriptStackTrace
Command Arguments Location ------- --------- -------- MyModuleWorkflowF1 {} TestNoFile3.psm1: line 6
WFTest1 {} TestNoFile2.ps1:
TestNoFile2.ps1 {} TestNoFile2.ps1: line 22 <ScriptBlock> {} <No file>
-Start an interactive debugging session with this runspace by running the Debug-Runspace cmdlet.
-
-PS C:\> [Process: 1520]: PS C:\> Debug-Runspace -Id 4
+[Process: 1520]: PS C:\> Debug-Runspace -Id 4
Hit Line breakpoint on 'C:\TestWFVar1.ps1:83' At C:\TestWFVar1.ps1:83 char:1 + $scriptVar = "Script Variable" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-[Process: 1520]: [RSDBG: 4]: PS C:\> >
+[Process: 1520]: [RSDBG: 4]: PS C:\>
+```
+
+Start an interactive debugging session with this runspace by running the `Debug-Runspace` cmdlet.
+
+### Example part 3: Finish the debugging session and exit
After you are finished debugging, allow the script to continue running without the debugger attached by running the exit debugger command. Alternatively, you can quit the debugger with the q or Stop commands.
-PS C:\> [Process:346]: [RSDBG: 3]: PS C:\> > exit
-[Process:1520]: PS C:\>
-
-When you are finished working in the process, exit the process by running the Exit-PSHostProcess
-cmdlet. This returns you to the PS C:\> prompt.
+When you are finished working in the process, exit the process by running the `Exit-PSHostProcess`
+cmdlet. This returns you to the `PS C:\>` prompt.
-PS C:\> [Process:1520]: PS C:\> Exit-PSHostProcess
+```
+[Process:346]: [RSDBG: 3]: PS C:\> exit
+[Process:1520]: PS C:\>
+[Process:1520]: PS C:\> Exit-PSHostProcess
PS C:\> ```
Microsoft.PowerShell.Security Set Acl (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md
external help file: Microsoft.PowerShell.Security.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Security Previously updated : 06/09/2017 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.security/set-acl?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Set-Acl
$NewAcl.SetAccessRuleProtection($isProtected, $preserveInheritance)
Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl ```
-These commands is will disable access inheritance from parent folders, while still preserving the
-existing inherited access rules.
+These commands disable access inheritance from parent folders, while still preserving the existing
+inherited access rules.
The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. Next, variables are created to convert the inherited access rules to explicit access rules. To protect the access rules associated with this from inheritance, set the `$isProtected` variable to
-`$true`.to allow inheritance, set `$isProtected` to `$false`. For more information, see
+`$true`. To allow inheritance, set `$isProtected` to `$false`. For more information, see
[set access rule protection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection).
-The `$preserveInheritance` variable set to `$true` to preserve inherited access rules; false to
+
+Set the `$preserveInheritance` variable to `$true` to preserve inherited access rules or `$false` to
remove inherited access rules. Then the access rule protection is updated using the **SetAccessRuleProtection()** method.
Microsoft.PowerShell.Utility Format Wide (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md
Accept wildcard characters: False
### -Property
-Specifies the object properties that appear in the display and the order in which they appear.
+Specifies the object property that appears in the display.
Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being
Microsoft.PowerShell.Core About Scopes (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Core/About/about_Scopes.md
--- description: Explains the concept of scope in PowerShell and shows how to set and change the scope of elements. Locale: en-US Previously updated : 10/22/2021 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Scopes
The following are the basic rules of scope:
scopes are child scopes of that parent. - An item is visible in the scope in which it was created and in any child
- scopes, unless you explicitly make it private. You can place variables,
- aliases, functions, or PowerShell drives in one or more scopes.
+ scopes, unless you explicitly make it private.
+
+- You can declare variables, aliases, functions, and PowerShell drives in a
+ scope outside of the current scope.
- An item that you created within a scope can be changed only in the scope in which it was created, unless you explicitly specify a different scope.
Microsoft.PowerShell.Core Enter Pshostprocess (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Core/Enter-PSHostProcess.md
external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core Previously updated : 11/04/2019 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/enter-pshostprocess?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Enter-PSHostProcess
session.
## Examples
-### Example 1: Start debugging a runspace within the PowerShell ISE process
+### Example Part 1: Start debugging a runspace within the PowerShell ISE process
In this example, you run `Enter-PSHostProcess` from within the PowerShell console to enter the PowerShell ISE process. In the resulting interactive session, you can find a runspace that you want
to debug by running `Get-Runspace`, and then debug the runspace.
``` PS C:\> Enter-PSHostProcess -Name powershell_ise
-[Process:1520]: PS C:\Test\Documents>
-
-Next, get available runspaces within the process you have entered.
-PS C:\> [Process:1520]: PS C:\> Get-Runspace
+[Process:1520]: PS C:\> Get-Runspace
Id Name InstanceId State Availability -- ------- ----------- ------ ------------- 1 Runspace1 2d91211d-9cce-42f0-ab0e-71ac258b32b5 Opened Available
Id Name InstanceId State Ava
3 MyLocalRS 2236dbd8-2105-4dec-a15a-a27d0bfaacb5 Opened LocalDebug 4 MyRunspace 771356e9-8c44-4b70-9de5-dd17cb41e48e Opened Busy 5 Runspace8 3e517382-a97a-49ba-9c3c-fd21f6664288 Broken None
+```
+
+### Example part 2: Debug a specific runspace
-The runspace objects returned by Get-Runspace also have a NoteProperty called ScriptStackTrace of
-the running command stack, if available.Next, debug runspace ID 4, that is running another user's
-long-running script. From the list returned from Get-Runspace, note that the runspace state is
-Opened, and Availability is Busy, meaning that the runspace is still running the long-running
-script.
+Next, debug runspace ID 4, that is running another user's long-running script. From the list
+returned from `Get-Runspace`, note that the runspace **State** is Opened, and **Availability** is
+Busy, meaning that the runspace is still running the long-running script. The runspace objects
+returned by `Get-Runspace` also have a **NoteProperty** called **ScriptStackTrace** of the running
+command stack, if available.
-PS C:\> [Process:1520]: PS C:\> (Get-Runspace -Id 4).ScriptStackTrace
+```
+[Process:1520]: PS C:\> (Get-Runspace -Id 4).ScriptStackTrace
Command Arguments Location ------- --------- -------- MyModuleWorkflowF1 {} TestNoFile3.psm1: line 6
WFTest1 {} TestNoFile2.ps1:
TestNoFile2.ps1 {} TestNoFile2.ps1: line 22 <ScriptBlock> {} <No file>
-Start an interactive debugging session with this runspace by running the Debug-Runspace cmdlet.
-
-PS C:\> [Process: 1520]: PS C:\> Debug-Runspace -Id 4
+[Process: 1520]: PS C:\> Debug-Runspace -Id 4
Hit Line breakpoint on 'C:\TestWFVar1.ps1:83' At C:\TestWFVar1.ps1:83 char:1 + $scriptVar = "Script Variable" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-[Process: 1520]: [RSDBG: 4]: PS C:\> >
+[Process: 1520]: [RSDBG: 4]: PS C:\>
+```
+
+Start an interactive debugging session with this runspace by running the `Debug-Runspace` cmdlet.
+
+### Example part 3: Finish the debugging session and exit
After you are finished debugging, allow the script to continue running without the debugger attached by running the exit debugger command. Alternatively, you can quit the debugger with the q or Stop commands.
-PS C:\> [Process:346]: [RSDBG: 3]: PS C:\> > exit
-[Process:1520]: PS C:\>
-
-When you are finished working in the process, exit the process by running the Exit-PSHostProcess
-cmdlet. This returns you to the PS C:\> prompt.
+When you are finished working in the process, exit the process by running the `Exit-PSHostProcess`
+cmdlet. This returns you to the `PS C:\>` prompt.
-PS C:\> [Process:1520]: PS C:\> Exit-PSHostProcess
+```
+[Process:346]: [RSDBG: 3]: PS C:\> exit
+[Process:1520]: PS C:\>
+[Process:1520]: PS C:\> Exit-PSHostProcess
PS C:\> ```
Microsoft.PowerShell.Security Set Acl (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Security/Set-Acl.md
external help file: Microsoft.PowerShell.Security.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Security Previously updated : 06/09/2017 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.security/set-acl?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Set-Acl
$NewAcl.SetAccessRuleProtection($isProtected, $preserveInheritance)
Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl ```
-These commands is will disable access inheritance from parent folders, while still preserving the
-existing inherited access rules.
+These commands disable access inheritance from parent folders, while still preserving the existing
+inherited access rules.
The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. Next, variables are created to convert the inherited access rules to explicit access rules. To protect the access rules associated with this from inheritance, set the `$isProtected` variable to
-`$true`.to allow inheritance, set `$isProtected` to `$false`. For more information, see
+`$true`. To allow inheritance, set `$isProtected` to `$false`. For more information, see
[set access rule protection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection).
-The `$preserveInheritance` variable set to `$true` to preserve inherited access rules; false to
+
+Set the `$preserveInheritance` variable to `$true` to preserve inherited access rules or `$false` to
remove inherited access rules. Then the access rule protection is updated using the **SetAccessRuleProtection()** method.
Microsoft.PowerShell.Utility Format Wide (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Utility/Format-Wide.md
Accept wildcard characters: False
### -Property
-Specifies the object properties that appear in the display and the order in which they appear.
+Specifies the object property that appears in the display.
Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being
Microsoft.PowerShell.Core About Scopes (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Core/About/about_Scopes.md
--- description: Explains the concept of scope in PowerShell and shows how to set and change the scope of elements. Locale: en-US Previously updated : 10/22/2021 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Scopes
The following are the basic rules of scope:
scopes are child scopes of that parent. - An item is visible in the scope in which it was created and in any child
- scopes, unless you explicitly make it private. You can place variables,
- aliases, functions, or PowerShell drives in one or more scopes.
+ scopes, unless you explicitly make it private.
+
+- You can declare variables, aliases, functions, and PowerShell drives in a
+ scope outside of the current scope.
- An item that you created within a scope can be changed only in the scope in which it was created, unless you explicitly specify a different scope.
Microsoft.PowerShell.Core Enter Pshostprocess (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Core/Enter-PSHostProcess.md
external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core Previously updated : 07/23/2020 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/enter-pshostprocess?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Enter-PSHostProcess
session.
## Examples
-### Example 1: Start debugging a runspace within the PowerShell ISE process
+### Example Part 1: Start debugging a runspace within the PowerShell ISE process
In this example, you run `Enter-PSHostProcess` from within the PowerShell console to enter the PowerShell ISE process. In the resulting interactive session, you can find a runspace that you want
to debug by running `Get-Runspace`, and then debug the runspace.
``` PS C:\> Enter-PSHostProcess -Name powershell_ise
-[Process:1520]: PS C:\Test\Documents>
-
-Next, get available runspaces within the process you have entered.
-PS C:\> [Process:1520]: PS C:\> Get-Runspace
+[Process:1520]: PS C:\> Get-Runspace
Id Name InstanceId State Availability -- ------- ----------- ------ ------------- 1 Runspace1 2d91211d-9cce-42f0-ab0e-71ac258b32b5 Opened Available
Id Name InstanceId State Ava
3 MyLocalRS 2236dbd8-2105-4dec-a15a-a27d0bfaacb5 Opened LocalDebug 4 MyRunspace 771356e9-8c44-4b70-9de5-dd17cb41e48e Opened Busy 5 Runspace8 3e517382-a97a-49ba-9c3c-fd21f6664288 Broken None
+```
-The runspace objects returned by Get-Runspace also have a NoteProperty called ScriptStackTrace of
-the running command stack, if available.Next, debug runspace ID 4, that is running another user's
-long-running script. From the list returned from Get-Runspace, note that the runspace state is
-Opened, and Availability is Busy, meaning that the runspace is still running the long-running
-script.
+### Example part 2: Debug a specific runspace
-PS C:\> [Process:1520]: PS C:\> (Get-Runspace -Id 4).ScriptStackTrace
+Next, debug runspace ID 4, that is running another user's long-running script. From the list
+returned from `Get-Runspace`, note that the runspace **State** is Opened, and **Availability** is
+Busy, meaning that the runspace is still running the long-running script. The runspace objects
+returned by `Get-Runspace` also have a **NoteProperty** called **ScriptStackTrace** of the running
+command stack, if available.
+
+```
+[Process:1520]: PS C:\> (Get-Runspace -Id 4).ScriptStackTrace
Command Arguments Location ------- --------- -------- MyModuleWorkflowF1 {} TestNoFile3.psm1: line 6
WFTest1 {} TestNoFile2.ps1:
TestNoFile2.ps1 {} TestNoFile2.ps1: line 22 <ScriptBlock> {} <No file>
-Start an interactive debugging session with this runspace by running the Debug-Runspace cmdlet.
-
-PS C:\> [Process: 1520]: PS C:\> Debug-Runspace -Id 4
+[Process: 1520]: PS C:\> Debug-Runspace -Id 4
Hit Line breakpoint on 'C:\TestWFVar1.ps1:83' At C:\TestWFVar1.ps1:83 char:1 + $scriptVar = "Script Variable" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-[Process: 1520]: [RSDBG: 4]: PS C:\> >
+[Process: 1520]: [RSDBG: 4]: PS C:\>
+```
+
+Start an interactive debugging session with this runspace by running the `Debug-Runspace` cmdlet.
+
+### Example part 3: Finish the debugging session and exit
After you are finished debugging, allow the script to continue running without the debugger attached by running the exit debugger command. Alternatively, you can quit the debugger with the q or Stop commands.
-PS C:\> [Process:346]: [RSDBG: 3]: PS C:\> > exit
-[Process:1520]: PS C:\>
-
-When you are finished working in the process, exit the process by running the Exit-PSHostProcess
-cmdlet. This returns you to the PS C:\> prompt.
+When you are finished working in the process, exit the process by running the `Exit-PSHostProcess`
+cmdlet. This returns you to the `PS C:\>` prompt.
-PS C:\> [Process:1520]: PS C:\> Exit-PSHostProcess
+```
+[Process:346]: [RSDBG: 3]: PS C:\> exit
+[Process:1520]: PS C:\>
+[Process:1520]: PS C:\> Exit-PSHostProcess
PS C:\> ```
capability was limited to sessions using WinRM. PowerShell 7.1 allows `Enter-PSS
[Exit-PSHostProcess](Exit-PSHostProcess.md) [Get-PSHostProcessInfo](Get-PSHostProcessInfo.md)-
Microsoft.PowerShell.Security Set Acl (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Security/Set-Acl.md
external help file: Microsoft.PowerShell.Security.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Security Previously updated : 06/09/2017 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.security/set-acl?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Set-Acl
$NewAcl.SetAccessRuleProtection($isProtected, $preserveInheritance)
Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl ```
-These commands is will disable access inheritance from parent folders, while still preserving the
-existing inherited access rules.
+These commands disable access inheritance from parent folders, while still preserving the existing
+inherited access rules.
The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. Next, variables are created to convert the inherited access rules to explicit access rules. To protect the access rules associated with this from inheritance, set the `$isProtected` variable to
-`$true`.to allow inheritance, set `$isProtected` to `$false`. For more information, see
+`$true`. To allow inheritance, set `$isProtected` to `$false`. For more information, see
[set access rule protection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection).
-The `$preserveInheritance` variable set to `$true` to preserve inherited access rules; false to
+
+Set the `$preserveInheritance` variable to `$true` to preserve inherited access rules or `$false` to
remove inherited access rules. Then the access rule protection is updated using the **SetAccessRuleProtection()** method.
Microsoft.PowerShell.Utility Format Wide (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Utility/Format-Wide.md
Accept wildcard characters: False
### -Property
-Specifies the object properties that appear in the display and the order in which they appear.
+Specifies the object property that appears in the display.
Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being
Microsoft.PowerShell.Core About Scopes (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Core/About/about_Scopes.md
--- description: Explains the concept of scope in PowerShell and shows how to set and change the scope of elements. Locale: en-US Previously updated : 10/22/2021 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Scopes
The following are the basic rules of scope:
scopes are child scopes of that parent. - An item is visible in the scope in which it was created and in any child
- scopes, unless you explicitly make it private. You can place variables,
- aliases, functions, or PowerShell drives in one or more scopes.
+ scopes, unless you explicitly make it private.
+
+- You can declare variables, aliases, functions, and PowerShell drives in a
+ scope outside of the current scope.
- An item that you created within a scope can be changed only in the scope in which it was created, unless you explicitly specify a different scope.
Microsoft.PowerShell.Core Enter Pshostprocess (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Core/Enter-PSHostProcess.md
external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core Previously updated : 07/23/2020 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/enter-pshostprocess?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Enter-PSHostProcess
session.
## Examples
-### Example 1: Start debugging a runspace within the PowerShell ISE process
+### Example Part 1: Start debugging a runspace within the PowerShell ISE process
In this example, you run `Enter-PSHostProcess` from within the PowerShell console to enter the PowerShell ISE process. In the resulting interactive session, you can find a runspace that you want
to debug by running `Get-Runspace`, and then debug the runspace.
``` PS C:\> Enter-PSHostProcess -Name powershell_ise
-[Process:1520]: PS C:\Test\Documents>
-
-Next, get available runspaces within the process you have entered.
-PS C:\> [Process:1520]: PS C:\> Get-Runspace
+[Process:1520]: PS C:\> Get-Runspace
Id Name InstanceId State Availability -- ------- ----------- ------ ------------- 1 Runspace1 2d91211d-9cce-42f0-ab0e-71ac258b32b5 Opened Available
Id Name InstanceId State Ava
3 MyLocalRS 2236dbd8-2105-4dec-a15a-a27d0bfaacb5 Opened LocalDebug 4 MyRunspace 771356e9-8c44-4b70-9de5-dd17cb41e48e Opened Busy 5 Runspace8 3e517382-a97a-49ba-9c3c-fd21f6664288 Broken None
+```
+
+### Example part 2: Debug a specific runspace
-The runspace objects returned by Get-Runspace also have a NoteProperty called ScriptStackTrace of
-the running command stack, if available.Next, debug runspace ID 4, that is running another user's
-long-running script. From the list returned from Get-Runspace, note that the runspace state is
-Opened, and Availability is Busy, meaning that the runspace is still running the long-running
-script.
+Next, debug runspace ID 4, that is running another user's long-running script. From the list
+returned from `Get-Runspace`, note that the runspace **State** is Opened, and **Availability** is
+Busy, meaning that the runspace is still running the long-running script. The runspace objects
+returned by `Get-Runspace` also have a **NoteProperty** called **ScriptStackTrace** of the running
+command stack, if available.
-PS C:\> [Process:1520]: PS C:\> (Get-Runspace -Id 4).ScriptStackTrace
+```
+[Process:1520]: PS C:\> (Get-Runspace -Id 4).ScriptStackTrace
Command Arguments Location ------- --------- -------- MyModuleWorkflowF1 {} TestNoFile3.psm1: line 6
WFTest1 {} TestNoFile2.ps1:
TestNoFile2.ps1 {} TestNoFile2.ps1: line 22 <ScriptBlock> {} <No file>
-Start an interactive debugging session with this runspace by running the Debug-Runspace cmdlet.
-
-PS C:\> [Process: 1520]: PS C:\> Debug-Runspace -Id 4
+[Process: 1520]: PS C:\> Debug-Runspace -Id 4
Hit Line breakpoint on 'C:\TestWFVar1.ps1:83' At C:\TestWFVar1.ps1:83 char:1 + $scriptVar = "Script Variable" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-[Process: 1520]: [RSDBG: 4]: PS C:\> >
+[Process: 1520]: [RSDBG: 4]: PS C:\>
+```
+
+Start an interactive debugging session with this runspace by running the `Debug-Runspace` cmdlet.
+
+### Example part 3: Finish the debugging session and exit
After you are finished debugging, allow the script to continue running without the debugger attached by running the exit debugger command. Alternatively, you can quit the debugger with the q or Stop commands.
-PS C:\> [Process:346]: [RSDBG: 3]: PS C:\> > exit
-[Process:1520]: PS C:\>
-
-When you are finished working in the process, exit the process by running the Exit-PSHostProcess
-cmdlet. This returns you to the PS C:\> prompt.
+When you are finished working in the process, exit the process by running the `Exit-PSHostProcess`
+cmdlet. This returns you to the `PS C:\>` prompt.
-PS C:\> [Process:1520]: PS C:\> Exit-PSHostProcess
+```
+[Process:346]: [RSDBG: 3]: PS C:\> exit
+[Process:1520]: PS C:\>
+[Process:1520]: PS C:\> Exit-PSHostProcess
PS C:\> ```
Microsoft.PowerShell.Security Set Acl (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Security/Set-Acl.md
external help file: Microsoft.PowerShell.Security.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Security Previously updated : 06/09/2017 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.security/set-acl?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Set-Acl
$NewAcl.SetAccessRuleProtection($isProtected, $preserveInheritance)
Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl ```
-These commands is will disable access inheritance from parent folders, while still preserving the
-existing inherited access rules.
+These commands disable access inheritance from parent folders, while still preserving the existing
+inherited access rules.
The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. Next, variables are created to convert the inherited access rules to explicit access rules. To protect the access rules associated with this from inheritance, set the `$isProtected` variable to
-`$true`.to allow inheritance, set `$isProtected` to `$false`. For more information, see
+`$true`. To allow inheritance, set `$isProtected` to `$false`. For more information, see
[set access rule protection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection).
-The `$preserveInheritance` variable set to `$true` to preserve inherited access rules; false to
+
+Set the `$preserveInheritance` variable to `$true` to preserve inherited access rules or `$false` to
remove inherited access rules. Then the access rule protection is updated using the **SetAccessRuleProtection()** method.
Microsoft.PowerShell.Utility Format Wide (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Utility/Format-Wide.md
Accept wildcard characters: False
### -Property
-Specifies the object properties that appear in the display and the order in which they appear.
+Specifies the object property that appears in the display.
Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being
Microsoft.PowerShell.Core About Scopes (7.3) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.3/Microsoft.PowerShell.Core/About/about_Scopes.md
--- description: Explains the concept of scope in PowerShell and shows how to set and change the scope of elements. Locale: en-US Previously updated : 10/22/2021 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Scopes
The following are the basic rules of scope:
scopes are child scopes of that parent. - An item is visible in the scope in which it was created and in any child
- scopes, unless you explicitly make it private. You can place variables,
- aliases, functions, or PowerShell drives in one or more scopes.
+ scopes, unless you explicitly make it private.
+
+- You can declare variables, aliases, functions, and PowerShell drives in a
+ scope outside of the current scope.
- An item that you created within a scope can be changed only in the scope in which it was created, unless you explicitly specify a different scope.
Microsoft.PowerShell.Core Enter Pshostprocess (7.3) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.3/Microsoft.PowerShell.Core/Enter-PSHostProcess.md
external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core Previously updated : 07/23/2020 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/enter-pshostprocess?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Enter-PSHostProcess
session.
## Examples
-### Example 1: Start debugging a runspace within the PowerShell ISE process
+### Example Part 1: Start debugging a runspace within the PowerShell ISE process
In this example, you run `Enter-PSHostProcess` from within the PowerShell console to enter the PowerShell ISE process. In the resulting interactive session, you can find a runspace that you want
to debug by running `Get-Runspace`, and then debug the runspace.
``` PS C:\> Enter-PSHostProcess -Name powershell_ise
-[Process:1520]: PS C:\Test\Documents>
-
-Next, get available runspaces within the process you have entered.
-PS C:\> [Process:1520]: PS C:\> Get-Runspace
+[Process:1520]: PS C:\> Get-Runspace
Id Name InstanceId State Availability -- ------- ----------- ------ ------------- 1 Runspace1 2d91211d-9cce-42f0-ab0e-71ac258b32b5 Opened Available
Id Name InstanceId State Ava
3 MyLocalRS 2236dbd8-2105-4dec-a15a-a27d0bfaacb5 Opened LocalDebug 4 MyRunspace 771356e9-8c44-4b70-9de5-dd17cb41e48e Opened Busy 5 Runspace8 3e517382-a97a-49ba-9c3c-fd21f6664288 Broken None
+```
-The runspace objects returned by Get-Runspace also have a NoteProperty called ScriptStackTrace of
-the running command stack, if available.Next, debug runspace ID 4, that is running another user's
-long-running script. From the list returned from Get-Runspace, note that the runspace state is
-Opened, and Availability is Busy, meaning that the runspace is still running the long-running
-script.
+### Example part 2: Debug a specific runspace
-PS C:\> [Process:1520]: PS C:\> (Get-Runspace -Id 4).ScriptStackTrace
+Next, debug runspace ID 4, that is running another user's long-running script. From the list
+returned from `Get-Runspace`, note that the runspace **State** is Opened, and **Availability** is
+Busy, meaning that the runspace is still running the long-running script. The runspace objects
+returned by `Get-Runspace` also have a **NoteProperty** called **ScriptStackTrace** of the running
+command stack, if available.
+
+```
+[Process:1520]: PS C:\> (Get-Runspace -Id 4).ScriptStackTrace
Command Arguments Location ------- --------- -------- MyModuleWorkflowF1 {} TestNoFile3.psm1: line 6
WFTest1 {} TestNoFile2.ps1:
TestNoFile2.ps1 {} TestNoFile2.ps1: line 22 <ScriptBlock> {} <No file>
-Start an interactive debugging session with this runspace by running the Debug-Runspace cmdlet.
-
-PS C:\> [Process: 1520]: PS C:\> Debug-Runspace -Id 4
+[Process: 1520]: PS C:\> Debug-Runspace -Id 4
Hit Line breakpoint on 'C:\TestWFVar1.ps1:83' At C:\TestWFVar1.ps1:83 char:1 + $scriptVar = "Script Variable" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-[Process: 1520]: [RSDBG: 4]: PS C:\> >
+[Process: 1520]: [RSDBG: 4]: PS C:\>
+```
+
+Start an interactive debugging session with this runspace by running the `Debug-Runspace` cmdlet.
+
+### Example part 3: Finish the debugging session and exit
After you are finished debugging, allow the script to continue running without the debugger attached by running the exit debugger command. Alternatively, you can quit the debugger with the q or Stop commands.
-PS C:\> [Process:346]: [RSDBG: 3]: PS C:\> > exit
-[Process:1520]: PS C:\>
-
-When you are finished working in the process, exit the process by running the Exit-PSHostProcess
-cmdlet. This returns you to the PS C:\> prompt.
+When you are finished working in the process, exit the process by running the `Exit-PSHostProcess`
+cmdlet. This returns you to the `PS C:\>` prompt.
-PS C:\> [Process:1520]: PS C:\> Exit-PSHostProcess
+```
+[Process:346]: [RSDBG: 3]: PS C:\> exit
+[Process:1520]: PS C:\>
+[Process:1520]: PS C:\> Exit-PSHostProcess
PS C:\> ```
capability was limited to sessions using WinRM. PowerShell 7.1 allows `Enter-PSS
[Exit-PSHostProcess](Exit-PSHostProcess.md) [Get-PSHostProcessInfo](Get-PSHostProcessInfo.md)-
Microsoft.PowerShell.Security Set Acl (7.3) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.3/Microsoft.PowerShell.Security/Set-Acl.md
external help file: Microsoft.PowerShell.Security.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Security Previously updated : 06/09/2017 Last updated : 01/31/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.security/set-acl?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Set-Acl
$NewAcl.SetAccessRuleProtection($isProtected, $preserveInheritance)
Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl ```
-These commands is will disable access inheritance from parent folders, while still preserving the
-existing inherited access rules.
+These commands disable access inheritance from parent folders, while still preserving the existing
+inherited access rules.
The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. Next, variables are created to convert the inherited access rules to explicit access rules. To protect the access rules associated with this from inheritance, set the `$isProtected` variable to
-`$true`.to allow inheritance, set `$isProtected` to `$false`. For more information, see
+`$true`. To allow inheritance, set `$isProtected` to `$false`. For more information, see
[set access rule protection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection).
-The `$preserveInheritance` variable set to `$true` to preserve inherited access rules; false to
+
+Set the `$preserveInheritance` variable to `$true` to preserve inherited access rules or `$false` to
remove inherited access rules. Then the access rule protection is updated using the **SetAccessRuleProtection()** method.
Microsoft.PowerShell.Utility Format Wide (7.3) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.3/Microsoft.PowerShell.Utility/Format-Wide.md
Accept wildcard characters: False
### -Property
-Specifies the object properties that appear in the display and the order in which they appear.
+Specifies the object property that appears in the display.
Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being
developer Approved Verbs For Windows Powershell Commands https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/developer/cmdlet/approved-verbs-for-windows-powershell-commands.md
--- description: Approved Verbs for PowerShell Commands Previously updated : 01/25/2022 Last updated : 01/31/2022 Title: Approved Verbs for PowerShell Commands ---
You may get a complete list of verbs using the `Get-Verb` cmdlet.
The following similar verbs represent different actions.
+### New vs. Add
+
+Use the `New` verb to create a new resource. Use the `Add` to add something to an existing container
+or resource. For example, `Add-Content` adds output to an existing file.
+ ### New vs. Set Use the `New` verb to create a new resource. Use the `Set` verb to modify an existing resource,