Skip to content

Commit 4fb5b83

Browse files
authored
Merge pull request #11552 from MicrosoftDocs/main
11/25/2024 PM Publish
2 parents 4bf35d2 + 2f9d548 commit 4fb5b83

File tree

6 files changed

+132
-137
lines changed

6 files changed

+132
-137
lines changed

reference/5.1/Microsoft.PowerShell.Core/Enable-PSRemoting.md

Lines changed: 45 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: System.Management.Automation.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Core
5-
ms.date: 10/06/2023
5+
ms.date: 11/25/2024
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/enable-psremoting?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Enable-PSRemoting
@@ -15,25 +15,26 @@ Configures the computer to receive remote commands.
1515
## SYNTAX
1616

1717
```
18-
Enable-PSRemoting [-Force] [-SkipNetworkProfileCheck] [-WhatIf] [-Confirm] [<CommonParameters>]
18+
Enable-PSRemoting [-Force] [-SkipNetworkProfileCheck] [-WhatIf] [-Confirm]
19+
[<CommonParameters>]
1920
```
2021

2122
## DESCRIPTION
2223

2324
The `Enable-PSRemoting` cmdlet configures the computer to receive PowerShell remote commands that
2425
are sent by using the WS-Management technology.
2526

26-
PowerShell remoting is enabled by default on Windows Server 2012. You can use `Enable-PSRemoting`
27-
to enable PowerShell remoting on other supported versions of Windows and to re-enable remoting on
28-
Windows Server 2012 if it becomes disabled.
27+
PowerShell remoting is enabled by default on Windows Server 2012 and higher. You can use
28+
`Enable-PSRemoting` to enable PowerShell remoting on other supported versions of Windows and to
29+
re-enable remoting if it becomes disabled.
2930

30-
You have to run this command only one time on each computer that will receive commands. You do not
31-
have to run it on computers that only send commands. Because the configuration starts listeners, it
32-
is prudent to run it only where it is needed.
31+
You need to run this command only one time on each computer that receive commands. You don't need to
32+
run it on computers that only send commands. Because the configuration starts listeners, it's
33+
prudent to run it only where it's needed.
3334

34-
Beginning in PowerShell 3.0, the `Enable-PSRemoting` cmdlet can enable PowerShell remoting
35-
on client versions of Windows when the computer is on a public network. For more information, see
36-
the description of the **SkipNetworkProfileCheck** parameter.
35+
Beginning in PowerShell 3.0, the `Enable-PSRemoting` cmdlet can enable PowerShell remoting on client
36+
versions of Windows when the computer is on a public network. For more information, see the
37+
description of the **SkipNetworkProfileCheck** parameter.
3738

3839
The `Enable-PSRemoting` cmdlet performs the following operations:
3940

@@ -44,21 +45,20 @@ The `Enable-PSRemoting` cmdlet performs the following operations:
4445
- Creates a listener to accept requests on any IP address.
4546
- Enables a firewall exception for WS-Management communications.
4647
- Registers the **Microsoft.PowerShell** and **Microsoft.PowerShell.Workflow** session
47-
configurations, if it they are not already registered.
48-
- Registers the **Microsoft.PowerShell32** session configuration on 64-bit computers, if it is
48+
configurations, if it they're not already registered.
49+
- Registers the **Microsoft.PowerShell32** session configuration on 64-bit computers, if it's
4950
not already registered.
5051
- Enables all session configurations.
5152
- Changes the security descriptor of all session configurations to allow remote access.
5253
- Restarts the WinRM service to make the preceding changes effective.
5354

5455
To run this cmdlet on the Windows platform, start PowerShell by using the Run as administrator
55-
option. This does not apply to Linux or MacOS versions of PowerShell.
56+
option.
5657

57-
> [!CAUTION]
58-
> On systems that have both PowerShell 3.0 and PowerShell 2.0, do not use
59-
> PowerShell 2.0 to run the `Enable-PSRemoting` and `Disable-PSRemoting` cmdlets. The commands
60-
> might appear to succeed, but the remoting is not configured correctly. Remote commands and later
61-
> attempts to enable and disable remoting, are likely to fail.
58+
For more information about using PowerShell remoting, see the following articles:
59+
60+
- [about_Remote_Requirements](about/about_Remote_Requirements.md)
61+
- [about_Remote](about/about_Remote.md)
6262

6363
## EXAMPLES
6464

@@ -109,7 +109,7 @@ domain networks. The command uses the **SkipNetworkProfileCheck** parameter to a
109109
from public networks in the same local subnet. The command specifies the **Force** parameter to
110110
suppress confirmation messages.
111111

112-
The **SkipNetworkProfileCheck** parameter does not affect server versions of the Windows operating
112+
The **SkipNetworkProfileCheck** parameter doesn't affect server versions of the Windows operating
113113
system, which allow remote access from public networks in the same local subnet by default.
114114

115115
The `Set-NetFirewallRule` cmdlet in the **NetSecurity** module adds a firewall rule that allows
@@ -141,13 +141,12 @@ Accept wildcard characters: False
141141
### -SkipNetworkProfileCheck
142142
143143
Indicates that this cmdlet enables remoting on client versions of the Windows operating system when
144-
the computer is on a public network. This parameter enables a firewall rule for public networks
145-
that allows remote access only from computers in the same local subnet.
144+
the computer is on a public network. This parameter enables a firewall rule for public networks that
145+
allows remote access only from computers in the same local subnet.
146146
147-
This parameter does not affect server versions of the Windows operating system, which, by default,
148-
have a local subnet firewall rule for public networks. If the local subnet firewall rule is
149-
disabled on a server version, `Enable-PSRemoting` re-enables it, regardless of the value of this
150-
parameter.
147+
This parameter doesn't affect server versions of the Windows operating system, which, by default,
148+
have a local subnet firewall rule for public networks. If the local subnet firewall rule is disabled
149+
on a server version, `Enable-PSRemoting` re-enables it, regardless of the value of this parameter.
151150

152151
To remove the local subnet restriction and enable remote access from all locations on public
153152
networks, use the `Set-NetFirewallRule` cmdlet in the **NetSecurity** module.
@@ -184,8 +183,7 @@ Accept wildcard characters: False
184183

185184
### -WhatIf
186185

187-
Shows what would happen if the cmdlet runs.
188-
The cmdlet is not run.
186+
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
189187

190188
```yaml
191189
Type: System.Management.Automation.SwitchParameter
@@ -203,7 +201,8 @@ Accept wildcard characters: False
203201

204202
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
205203
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
206-
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
204+
-WarningAction, and -WarningVariable. For more information, see
205+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
207206

208207
## INPUTS
209208

@@ -219,42 +218,28 @@ This cmdlet returns strings that describe its results.
219218

220219
## NOTES
221220

222-
In PowerShell 3.0, `Enable-PSRemoting` creates the following firewall exceptions for
223-
WS-Management communications.
224-
225-
On server versions of the Windows operating system, `Enable-PSRemoting` creates firewall rules
226-
for private and domain networks that allow remote access, and creates a firewall rule for public
227-
networks that allows remote access only from computers in the same local subnet.
228-
229-
On client versions of the Windows operating system, `Enable-PSRemoting` in PowerShell 3.0 creates
230-
firewall rules for private and domain networks that allow unrestricted remote access. To create a
231-
firewall rule for public networks that allows remote access from the same local subnet, use the
232-
**SkipNetworkProfileCheck** parameter.
233-
234-
On client or server versions of the Windows operating system, to create a firewall rule for public
235-
networks that removes the local subnet restriction and allows remote access , use the
236-
`Set-NetFirewallRule` cmdlet in the NetSecurity module to run the following command:
237-
`Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC" -RemoteAddress Any`
221+
Starting in PowerShell 3.0, `Enable-PSRemoting` enables all session configurations by setting the
222+
value of the **Enabled** property of all session configurations to `$True`.
238223

239-
In PowerShell 2.0, `Enable-PSRemoting` creates the following firewall exceptions for WS-Management
240-
communications.
224+
- On server versions of the Windows operating system, `Enable-PSRemoting` creates firewall rules for
225+
private and domain networks that allow remote access, and creates a firewall rule for public
226+
networks that allows remote access only from computers in the same local subnet.
241227

242-
On server versions of the Windows operating system, it creates firewall rules for all networks that
243-
allow remote access.
228+
- On client versions of the Windows operating system, `Enable-PSRemoting` in PowerShell 3.0 creates
229+
firewall rules for private and domain networks that allow unrestricted remote access. To create a
230+
firewall rule for public networks that allows remote access from the same local subnet, use the
231+
**SkipNetworkProfileCheck** parameter.
244232

245-
On client versions of the Windows operating system, `Enable-PSRemoting` in PowerShell 2.0
246-
creates a firewall exception only for domain and private network locations. To minimize security
247-
risks, `Enable-PSRemoting` does not create a firewall rule for public networks on client versions
248-
of Windows. When the current network location is public, `Enable-PSRemoting` returns the following
249-
message: Unable to check the status of the firewall.
233+
- On client or server versions of the Windows operating system, to create a firewall rule for public
234+
networks that removes the local subnet restriction and allows remote access , use the
235+
`Set-NetFirewallRule` cmdlet in the NetSecurity module to run the following command:
236+
`Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC" -RemoteAddress Any`
250237

251-
Starting in PowerShell 3.0, `Enable-PSRemoting` enables all session configurations by setting the
252-
value of the **Enabled** property of all session configurations to `$True`.
238+
`Enable-PSRemoting` enables all session configurations by setting the value of the **Enabled**
239+
property of all session configurations to `$True`.
253240

254-
In PowerShell 2.0, `Enable-PSRemoting` removes the **Deny_All** setting from the security
255-
descriptor of session configurations. In PowerShell 3.0, `Enable-PSRemoting` removes the
256-
**Deny_All** and **Network_Deny_All** settings. This provides remote access to session
257-
configurations that were reserved for local use.
241+
`Enable-PSRemoting` removes the **Deny_All** and **Network_Deny_All** settings. This provides remote
242+
access to session configurations that were reserved for local use.
258243

259244
## RELATED LINKS
260245

reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Utility
5-
ms.date: 12/12/2022
5+
ms.date: 11/25/2024
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/add-type?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Add-Type
@@ -64,7 +64,7 @@ the class is available in all PowerShell sessions.
6464

6565
You can specify the type by specifying an existing assembly or source code files, or you can specify
6666
the source code inline or saved in a variable. You can even specify only a method and `Add-Type`
67-
will define and generate the class. On Windows, you can use this feature to make Platform Invoke
67+
defines and generates the class. On Windows, you can use this feature to make Platform Invoke
6868
(P/Invoke) calls to unmanaged functions in PowerShell. If you specify source code, `Add-Type`
6969
compiles the specified source code and generates an in-memory assembly that contains the new .NET
7070
Framework types.
@@ -77,7 +77,7 @@ the resulting assembly.
7777

7878
### Example 1: Add a .NET type to a session
7979

80-
This example adds the **BasicTest** class to the session by specifying source code that is stored in
80+
This example adds the **BasicTest** class to the session by specifying source code that's stored in
8181
a variable. The **BasicTest** class is used to add integers, create an object, and multiply
8282
integers.
8383

@@ -240,7 +240,7 @@ PowerShell console. The method takes two parameters: the window handle, and an i
240240
specifies how the window is displayed.
241241

242242
To minimize the PowerShell console, `ShowWindowAsync` uses the `Get-Process` cmdlet with the `$PID`
243-
automatic variable to get the process that is hosting the current PowerShell session. Then it uses
243+
automatic variable to get the process that's hosting the current PowerShell session. Then it uses
244244
the **MainWindowHandle** property of the current process and a value of `2`, which represents the
245245
`SW_MINIMIZE` value.
246246

@@ -484,7 +484,7 @@ Accept wildcard characters: False
484484

485485
### -MemberDefinition
486486

487-
Specifies new properties or methods for the class. `Add-Type` generates the template code that is
487+
Specifies new properties or methods for the class. `Add-Type` generates the template code that's
488488
required to support the properties or methods.
489489

490490
On Windows, you can use this feature to make Platform Invoke (P/Invoke) calls to unmanaged functions
@@ -525,12 +525,10 @@ Accept wildcard characters: False
525525

526526
### -Namespace
527527

528-
Specifies a namespace for the type.
529-
530-
If this parameter isn't included in the command, the type is created in the
531-
**Microsoft.PowerShell.Commands.AddType.AutoGeneratedTypes** namespace. If the parameter is included
532-
in the command with an empty string value or a value of `$Null`, the type is generated in the global
533-
namespace.
528+
By default, this command creates the type in the
529+
**Microsoft.PowerShell.Commands.AddType.AutoGeneratedTypes** namespace. When you use this parameter,
530+
the type is created in the specified namespace. If the value an empty string, the type is created in
531+
the global namespace.
534532

535533
```yaml
536534
Type: System.String
@@ -548,7 +546,8 @@ Accept wildcard characters: False
548546

549547
Generates a DLL file for the assembly with the specified name in the location. Enter an optional
550548
path and filename. Wildcard characters are permitted. By default, `Add-Type` generates the assembly
551-
only in memory.
549+
only in memory. If you output the assembly to a file you should include the **PassThru** parameter
550+
to return the type from the newly created assembly.
552551

553552
```yaml
554553
Type: System.String
@@ -566,7 +565,8 @@ Accept wildcard characters: True
566565

567566
Specifies the output type of the output assembly. By default, no output type is specified. This
568567
parameter is valid only when an output assembly is specified in the command. For more information
569-
about the values, see [OutputAssemblyType Enumeration](/dotnet/api/microsoft.powershell.commands.outputassemblytype).
568+
about the values, see
569+
[OutputAssemblyType Enumeration](/dotnet/api/microsoft.powershell.commands.outputassemblytype).
570570

571571
The acceptable values for this parameter are as follows:
572572

@@ -590,7 +590,8 @@ Accept wildcard characters: False
590590
### -PassThru
591591

592592
Returns a **System.Runtime** object that represents the types that were added. By default, this
593-
cmdlet doesn't generate any output.
593+
cmdlet doesn't generate any output. Use this parameter if you used **OutputAssembly** to create a
594+
DLL file and you want to return the type from the newly created assembly.
594595

595596
```yaml
596597
Type: System.Management.Automation.SwitchParameter
@@ -697,7 +698,8 @@ Accept wildcard characters: False
697698

698699
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
699700
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
700-
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
701+
-WarningAction, and -WarningVariable. For more information, see
702+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
701703

702704
## INPUTS
703705

@@ -719,7 +721,8 @@ the new type.
719721
## NOTES
720722

721723
The types that you add exist only in the current session. To use the types in all sessions, add them
722-
to your PowerShell profile. For more information about the profile, see [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md).
724+
to your PowerShell profile. For more information about the profile, see
725+
[about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md).
723726

724727
Type names and namespaces must be unique within a session. You can't unload a type or change it. If
725728
you need to change the code for a type, you must change the name or start a new PowerShell session.

reference/7.4/Microsoft.PowerShell.Core/Enable-PSRemoting.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: System.Management.Automation.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Core
5-
ms.date: 10/06/2023
5+
ms.date: 11/25/2024
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/enable-psremoting?view=powershell-7.4&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Enable-PSRemoting
@@ -31,9 +31,9 @@ PowerShell remoting is enabled by default on Windows Server platforms. You can u
3131
`Enable-PSRemoting` to enable PowerShell remoting on other supported versions of Windows and to
3232
re-enable remoting if it becomes disabled.
3333

34-
You have to run this command only one time on each computer that will receive commands. You do not
35-
have to run it on computers that only send commands. Because the configuration starts listeners to
36-
accept remote connections, it is prudent to run it only where it is needed.
34+
You need to run this command only one time on each computer that receive commands. You don't need to
35+
run it on computers that only send commands. Because the configuration starts listeners, it's
36+
prudent to run it only where it's needed.
3737

3838
Enabling PowerShell remoting on client versions of Windows when the computer is on a public network
3939
is normally disallowed, but you can skip this restriction by using the **SkipNetworkProfileCheck**
@@ -81,6 +81,11 @@ option. This cmdlet is not available on Linux or MacOS versions of PowerShell.
8181
> disable PowerShell remoting endpoints that are hosted by Windows PowerShell, run the
8282
> `Enable-PSRemoting` cmdlet from within a Windows PowerShell session.
8383
84+
For more information about using PowerShell remoting, see the following articles:
85+
86+
- [about_Remote_Requirements](about/about_Remote_Requirements.md)
87+
- [about_Remote](about/about_Remote.md)
88+
8489
## EXAMPLES
8590

8691
### Example 1: Configure a computer to receive remote commands
@@ -237,7 +242,7 @@ Indicates that this cmdlet enables remoting on client versions of the Windows op
237242
the computer is on a public network. This parameter enables a firewall rule for public networks that
238243
allows remote access only from computers in the same local subnet.
239244
240-
This parameter does not affect server versions of the Windows operating system, which, by default,
245+
This parameter doesn't affect server versions of the Windows operating system, which, by default,
241246
have a local subnet firewall rule for public networks. If the local subnet firewall rule is disabled
242247
on a server version, `Enable-PSRemoting` re-enables it, regardless of the value of this parameter.
243248

@@ -276,8 +281,7 @@ Accept wildcard characters: False
276281

277282
### -WhatIf
278283

279-
Shows what would happen if the cmdlet runs.
280-
The cmdlet is not run.
284+
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
281285

282286
```yaml
283287
Type: System.Management.Automation.SwitchParameter

0 commit comments

Comments
 (0)