Skip to content

Commit 597e54c

Browse files
authored
Add "Windows-only" note to parameters (#12052)
* Add "Windows-only" note to parameters. * restart
1 parent a743e3e commit 597e54c

File tree

6 files changed

+134
-47
lines changed

6 files changed

+134
-47
lines changed

reference/7.4/Microsoft.PowerShell.Management/Restart-Computer.md

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ Restart-Computer [-WsmanAuthentication <String>] [[-ComputerName] <String[]>]
2525

2626
## DESCRIPTION
2727

28-
> **This cmdlet is only available on the Windows platform.**
29-
3028
The `Restart-Computer` cmdlet restarts the operating system on the local and remote computers.
3129

3230
You can use the parameters of `Restart-Computer` to run the restart operations, to specify the
@@ -38,6 +36,12 @@ command. Specify a waiting time-out and query interval, and wait for particular
3836
available on the restarted computer. This feature makes it practical to use `Restart-Computer` in
3937
scripts and functions.
4038

39+
In PowerShell 7.1, `Restart-Computer` was added for Linux and macOS. The non-Windows platforms only
40+
have the **WhatIf**, **Confirm**, and **CommonParameters** parameters. The cmdlet is just calling
41+
the native command `/sbin/shutdown`.
42+
43+
## EXAMPLES
44+
4145
## EXAMPLES
4246

4347
### Example 1: Restart the local computer
@@ -108,7 +112,7 @@ queries the remote computer every two seconds to determine whether it's restarte
108112
`Restart-Computer` restarts the remote computer using the **WsmanAuthentication** mechanism.
109113
Kerberos authentication determines whether the current user has permission to restart the remote
110114
computer. For more information, see
111-
[AuthenticationMechanism](/dotnet/api/system.management.automation.runspaces.authenticationmechanism).
115+
[AuthenticationMechanism](xref:System.Management.Automation.Runspaces.AuthenticationMechanism).
112116

113117
```powershell
114118
Restart-Computer -ComputerName Server01 -WsmanAuthentication Kerberos
@@ -132,6 +136,8 @@ if your computer isn't configured to run remote commands.
132136

133137
If the **ComputerName** parameter isn't specified, `Restart-Computer` restarts the local computer.
134138

139+
This parameter is only available on Windows platforms.
140+
135141
```yaml
136142
Type: System.String[]
137143
Parameter Sets: (All)
@@ -152,12 +158,14 @@ Type a user name, such as **User01** or **Domain01\User01**, or enter a **PSCred
152158
generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the
153159
password.
154160

155-
Credentials are stored in a [PSCredential](/dotnet/api/system.management.automation.pscredential)
156-
object and the password is stored as a [SecureString](/dotnet/api/system.security.securestring).
161+
Credentials are stored in a [PSCredential](xref:System.Management.Automation.PSCredential)
162+
object and the password is stored as a [SecureString](xref:System.Security.SecureString).
157163

158164
> [!NOTE]
159165
> For more information about **SecureString** data protection, see
160-
> [How secure is SecureString?](/dotnet/api/system.security.securestring#how-secure-is-securestring).
166+
> [How secure is SecureString?](xref:System.Security.SecureString#how-secure-is-securestring).
167+
168+
This parameter is only available on Windows platforms.
161169

162170
```yaml
163171
Type: System.Management.Automation.PSCredential
@@ -182,6 +190,8 @@ This parameter was introduced in Windows PowerShell 3.0.
182190

183191
If the **Delay** parameter isn't specified, `Restart-Computer` uses a five second delay.
184192

193+
This parameter is only available on Windows platforms.
194+
185195
```yaml
186196
Type: System.Int16
187197
Parameter Sets: (All)
@@ -206,7 +216,8 @@ The acceptable values for this parameter are:
206216
- **WMI**: Receives a reply to a **Win32_ComputerSystem** query for the computer.
207217
- **WinRM**: Can establish a remote session to the computer by using WS-Management.
208218

209-
This parameter was introduced in Windows PowerShell 3.0.
219+
This parameter was introduced in Windows PowerShell 3.0. This parameter is only available on Windows
220+
platforms.
210221

211222
```yaml
212223
Type: Microsoft.PowerShell.Commands.WaitForServiceTypes
@@ -225,6 +236,8 @@ Accept wildcard characters: False
225236

226237
Forces an immediate restart of the computer.
227238

239+
This parameter is only available on Windows platforms.
240+
228241
```yaml
229242
Type: System.Management.Automation.SwitchParameter
230243
Parameter Sets: (All)
@@ -247,6 +260,8 @@ The **Timeout** parameter is only valid with the **Wait** parameter. **Timeout**
247260

248261
This parameter was introduced in Windows PowerShell 3.0.
249262

263+
This parameter is only available on Windows platforms.
264+
250265
```yaml
251266
Type: System.Int32
252267
Parameter Sets: (All)
@@ -274,7 +289,8 @@ The **Wait** parameter isn't valid when you're restarting the local computer. If
274289
`Restart-Computer` generates a non-terminating error for **Wait** on the local computer, but waits
275290
for the remote computers to restart.
276291

277-
This parameter was introduced in Windows PowerShell 3.0.
292+
This parameter was introduced in Windows PowerShell 3.0. This parameter is only available on Windows
293+
platforms.
278294

279295
```yaml
280296
Type: System.Management.Automation.SwitchParameter
@@ -297,7 +313,7 @@ The acceptable values for this parameter are: **Basic**, **CredSSP**, **Default*
297313
**Kerberos**, and **Negotiate**.
298314

299315
For more information, see
300-
[AuthenticationMechanism](/dotnet/api/system.management.automation.runspaces.authenticationmechanism).
316+
[AuthenticationMechanism](xref:System.Management.Automation.Runspaces.AuthenticationMechanism).
301317

302318
> [!WARNING]
303319
> Credential Security Service Provider (CredSSP) authentication, in which the user credentials are
@@ -306,6 +322,8 @@ For more information, see
306322
> increases the security risk of the remote operation. If the remote computer is compromised, the
307323
> credentials that are passed to it can be used to control the network session.
308324

325+
This parameter is only available on Windows platforms.
326+
309327
```yaml
310328
Type: System.String
311329
Parameter Sets: (All)
@@ -355,7 +373,8 @@ Accept wildcard characters: False
355373

356374
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
357375
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
358-
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
376+
-WarningAction, and -WarningVariable. For more information, see
377+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
359378

360379
## INPUTS
361380

@@ -371,11 +390,14 @@ This cmdlet returns no output.
371390

372391
## NOTES
373392

374-
- In Windows, `Restart-Computer` uses the [Win32Shutdown method](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem)
375-
of the Windows Management Instrumentation (WMI) [Win32_OperatingSystem](/windows/desktop/CIMWin32Prov/win32-operatingsystem)
376-
class. This method requires the **SeShutdownPrivilege** privilege be enabled for the user account
377-
used to restart the machine.
378-
- On Linux and macOS, `Restart-Computer` uses the `/sbin/shutdown` bash tool.
393+
- In Windows, `Restart-Computer` uses the
394+
[Win32Shutdown method](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem)
395+
of the Windows Management Instrumentation (WMI)
396+
[Win32_OperatingSystem](/windows/desktop/CIMWin32Prov/win32-operatingsystem) class. This method
397+
requires the **SeShutdownPrivilege** privilege be enabled for the user account used to restart
398+
the machine.
399+
- This cmdlet was added for Linux and macOS in PowerShell 7.1. On Linux and macOS,
400+
`Restart-Computer` uses the `/sbin/shutdown` bash tool.
379401

380402
## RELATED LINKS
381403

reference/7.4/Microsoft.PowerShell.Management/Stop-Computer.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Management
5-
ms.date: 05/15/2023
5+
ms.date: 05/07/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/stop-computer?view=powershell-7.4&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Stop-Computer
@@ -29,8 +29,9 @@ The `Stop-Computer` cmdlet shuts down the local computer and remote computers.
2929
You can use the parameters of `Stop-Computer` to specify the authentication levels and alternate
3030
credentials, and to force an immediate shut down.
3131

32-
In PowerShell 7.1, `Stop-Computer` was added for Linux and macOS. The parameters have no effect on
33-
these platforms. The cmdlet is just calling the native command `/sbin/shutdown`.
32+
In PowerShell 7.1, `Stop-Computer` was added for Linux and macOS. The non-Windows platforms only
33+
have the **WhatIf**, **Confirm**, and **CommonParameters** parameters. The cmdlet is just calling
34+
the native command `/sbin/shutdown`.
3435

3536
## EXAMPLES
3637

@@ -118,6 +119,8 @@ comma-separated list. To specify the local computer, type the computer name or l
118119
This parameter doesn't rely on PowerShell remoting. You can use the **ComputerName** parameter even
119120
if your computer isn't configured to run remote commands.
120121

122+
This parameter is only available on Windows platforms.
123+
121124
```yaml
122125
Type: System.String[]
123126
Parameter Sets: (All)
@@ -145,6 +148,8 @@ object and the password is stored as a [SecureString](/dotnet/api/system.securit
145148
> For more information about **SecureString** data protection, see
146149
> [How secure is SecureString?](/dotnet/api/system.security.securestring#how-secure-is-securestring).
147150

151+
This parameter is only available on Windows platforms.
152+
148153
```yaml
149154
Type: System.Management.Automation.PSCredential
150155
Parameter Sets: (All)
@@ -161,6 +166,8 @@ Accept wildcard characters: False
161166

162167
Forces an immediate shut down of the computer.
163168

169+
This parameter is only available on Windows platforms.
170+
164171
```yaml
165172
Type: System.Management.Automation.SwitchParameter
166173
Parameter Sets: (All)
@@ -197,7 +204,8 @@ For more information about the values of this parameter, see
197204
> increases the security risk of the remote operation. If the remote computer is compromised, the
198205
> credentials that are passed to it can be used to control the network session.
199206

200-
This parameter was introduced in PowerShell 3.0.
207+
This parameter was introduced in PowerShell 3.0. This parameter is only available on Windows
208+
platforms.
201209

202210
```yaml
203211
Type: System.String

reference/7.5/Microsoft.PowerShell.Management/Restart-Computer.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ Restart-Computer [-WsmanAuthentication <String>] [[-ComputerName] <String[]>]
2525

2626
## DESCRIPTION
2727

28-
> **This cmdlet is only available on the Windows platform.**
29-
3028
The `Restart-Computer` cmdlet restarts the operating system on the local and remote computers.
3129

3230
You can use the parameters of `Restart-Computer` to run the restart operations, to specify the
@@ -38,6 +36,12 @@ command. Specify a waiting time-out and query interval, and wait for particular
3836
available on the restarted computer. This feature makes it practical to use `Restart-Computer` in
3937
scripts and functions.
4038

39+
In PowerShell 7.1, `Restart-Computer` was added for Linux and macOS. The non-Windows platforms only
40+
have the **WhatIf**, **Confirm**, and **CommonParameters** parameters. The cmdlet is just calling
41+
the native command `/sbin/shutdown`.
42+
43+
## EXAMPLES
44+
4145
## EXAMPLES
4246

4347
### Example 1: Restart the local computer
@@ -132,6 +136,8 @@ if your computer isn't configured to run remote commands.
132136

133137
If the **ComputerName** parameter isn't specified, `Restart-Computer` restarts the local computer.
134138

139+
This parameter is only available on Windows platforms.
140+
135141
```yaml
136142
Type: System.String[]
137143
Parameter Sets: (All)
@@ -159,6 +165,8 @@ object and the password is stored as a [SecureString](xref:System.Security.Secur
159165
> For more information about **SecureString** data protection, see
160166
> [How secure is SecureString?](xref:System.Security.SecureString#how-secure-is-securestring).
161167

168+
This parameter is only available on Windows platforms.
169+
162170
```yaml
163171
Type: System.Management.Automation.PSCredential
164172
Parameter Sets: (All)
@@ -182,6 +190,8 @@ This parameter was introduced in Windows PowerShell 3.0.
182190

183191
If the **Delay** parameter isn't specified, `Restart-Computer` uses a five second delay.
184192

193+
This parameter is only available on Windows platforms.
194+
185195
```yaml
186196
Type: System.Int16
187197
Parameter Sets: (All)
@@ -206,7 +216,8 @@ The acceptable values for this parameter are:
206216
- **WMI**: Receives a reply to a **Win32_ComputerSystem** query for the computer.
207217
- **WinRM**: Can establish a remote session to the computer by using WS-Management.
208218

209-
This parameter was introduced in Windows PowerShell 3.0.
219+
This parameter was introduced in Windows PowerShell 3.0. This parameter is only available on Windows
220+
platforms.
210221

211222
```yaml
212223
Type: Microsoft.PowerShell.Commands.WaitForServiceTypes
@@ -225,6 +236,8 @@ Accept wildcard characters: False
225236

226237
Forces an immediate restart of the computer.
227238

239+
This parameter is only available on Windows platforms.
240+
228241
```yaml
229242
Type: System.Management.Automation.SwitchParameter
230243
Parameter Sets: (All)
@@ -247,6 +260,8 @@ The **Timeout** parameter is only valid with the **Wait** parameter. **Timeout**
247260

248261
This parameter was introduced in Windows PowerShell 3.0.
249262

263+
This parameter is only available on Windows platforms.
264+
250265
```yaml
251266
Type: System.Int32
252267
Parameter Sets: (All)
@@ -274,7 +289,8 @@ The **Wait** parameter isn't valid when you're restarting the local computer. If
274289
`Restart-Computer` generates a non-terminating error for **Wait** on the local computer, but waits
275290
for the remote computers to restart.
276291

277-
This parameter was introduced in Windows PowerShell 3.0.
292+
This parameter was introduced in Windows PowerShell 3.0. This parameter is only available on Windows
293+
platforms.
278294

279295
```yaml
280296
Type: System.Management.Automation.SwitchParameter
@@ -306,6 +322,8 @@ For more information, see
306322
> increases the security risk of the remote operation. If the remote computer is compromised, the
307323
> credentials that are passed to it can be used to control the network session.
308324

325+
This parameter is only available on Windows platforms.
326+
309327
```yaml
310328
Type: System.String
311329
Parameter Sets: (All)
@@ -378,7 +396,8 @@ This cmdlet returns no output.
378396
[Win32_OperatingSystem](/windows/desktop/CIMWin32Prov/win32-operatingsystem) class. This method
379397
requires the **SeShutdownPrivilege** privilege be enabled for the user account used to restart
380398
the machine.
381-
- On Linux and macOS, `Restart-Computer` uses the `/sbin/shutdown` bash tool.
399+
- This cmdlet was added for Linux and macOS in PowerShell 7.1. On Linux and macOS,
400+
`Restart-Computer` uses the `/sbin/shutdown` bash tool.
382401

383402
## RELATED LINKS
384403

reference/7.5/Microsoft.PowerShell.Management/Stop-Computer.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Management
5-
ms.date: 05/15/2023
5+
ms.date: 05/07/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/stop-computer?view=powershell-7.5&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Stop-Computer
@@ -29,8 +29,9 @@ The `Stop-Computer` cmdlet shuts down the local computer and remote computers.
2929
You can use the parameters of `Stop-Computer` to specify the authentication levels and alternate
3030
credentials, and to force an immediate shut down.
3131

32-
In PowerShell 7.1, `Stop-Computer` was added for Linux and macOS. The parameters have no effect on
33-
these platforms. The cmdlet is just calling the native command `/sbin/shutdown`.
32+
In PowerShell 7.1, `Stop-Computer` was added for Linux and macOS. The non-Windows platforms only
33+
have the **WhatIf**, **Confirm**, and **CommonParameters** parameters. The cmdlet is just calling
34+
the native command `/sbin/shutdown`.
3435

3536
## EXAMPLES
3637

@@ -118,6 +119,8 @@ comma-separated list. To specify the local computer, type the computer name or l
118119
This parameter doesn't rely on PowerShell remoting. You can use the **ComputerName** parameter even
119120
if your computer isn't configured to run remote commands.
120121

122+
This parameter is only available on Windows platforms.
123+
121124
```yaml
122125
Type: System.String[]
123126
Parameter Sets: (All)
@@ -145,6 +148,8 @@ object and the password is stored as a [SecureString](/dotnet/api/system.securit
145148
> For more information about **SecureString** data protection, see
146149
> [How secure is SecureString?](/dotnet/api/system.security.securestring#how-secure-is-securestring).
147150

151+
This parameter is only available on Windows platforms.
152+
148153
```yaml
149154
Type: System.Management.Automation.PSCredential
150155
Parameter Sets: (All)
@@ -161,6 +166,8 @@ Accept wildcard characters: False
161166

162167
Forces an immediate shut down of the computer.
163168

169+
This parameter is only available on Windows platforms.
170+
164171
```yaml
165172
Type: System.Management.Automation.SwitchParameter
166173
Parameter Sets: (All)
@@ -197,7 +204,8 @@ For more information about the values of this parameter, see
197204
> increases the security risk of the remote operation. If the remote computer is compromised, the
198205
> credentials that are passed to it can be used to control the network session.
199206

200-
This parameter was introduced in PowerShell 3.0.
207+
This parameter was introduced in PowerShell 3.0. This parameter is only available on Windows
208+
platforms.
201209

202210
```yaml
203211
Type: System.String

0 commit comments

Comments
 (0)