Skip to content

Add "Windows-only" note to parameters #12052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions reference/7.4/Microsoft.PowerShell.Management/Restart-Computer.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ Restart-Computer [-WsmanAuthentication <String>] [[-ComputerName] <String[]>]

## DESCRIPTION

> **This cmdlet is only available on the Windows platform.**

The `Restart-Computer` cmdlet restarts the operating system on the local and remote computers.

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

In PowerShell 7.1, `Restart-Computer` was added for Linux and macOS. The non-Windows platforms only
have the **WhatIf**, **Confirm**, and **CommonParameters** parameters. The cmdlet is just calling
the native command `/sbin/shutdown`.

## EXAMPLES

## EXAMPLES

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

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

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

This parameter is only available on Windows platforms.

```yaml
Type: System.String[]
Parameter Sets: (All)
Expand All @@ -152,12 +158,14 @@ Type a user name, such as **User01** or **Domain01\User01**, or enter a **PSCred
generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the
password.

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

> [!NOTE]
> For more information about **SecureString** data protection, see
> [How secure is SecureString?](/dotnet/api/system.security.securestring#how-secure-is-securestring).
> [How secure is SecureString?](xref:System.Security.SecureString#how-secure-is-securestring).

This parameter is only available on Windows platforms.

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

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

This parameter is only available on Windows platforms.

```yaml
Type: System.Int16
Parameter Sets: (All)
Expand All @@ -206,7 +216,8 @@ The acceptable values for this parameter are:
- **WMI**: Receives a reply to a **Win32_ComputerSystem** query for the computer.
- **WinRM**: Can establish a remote session to the computer by using WS-Management.

This parameter was introduced in Windows PowerShell 3.0.
This parameter was introduced in Windows PowerShell 3.0. This parameter is only available on Windows
platforms.

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

Forces an immediate restart of the computer.

This parameter is only available on Windows platforms.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Expand All @@ -247,6 +260,8 @@ The **Timeout** parameter is only valid with the **Wait** parameter. **Timeout**

This parameter was introduced in Windows PowerShell 3.0.

This parameter is only available on Windows platforms.

```yaml
Type: System.Int32
Parameter Sets: (All)
Expand Down Expand Up @@ -274,7 +289,8 @@ The **Wait** parameter isn't valid when you're restarting the local computer. If
`Restart-Computer` generates a non-terminating error for **Wait** on the local computer, but waits
for the remote computers to restart.

This parameter was introduced in Windows PowerShell 3.0.
This parameter was introduced in Windows PowerShell 3.0. This parameter is only available on Windows
platforms.

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

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

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

This parameter is only available on Windows platforms.

```yaml
Type: System.String
Parameter Sets: (All)
Expand Down Expand Up @@ -355,7 +373,8 @@ Accept wildcard characters: False

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

## INPUTS

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

## NOTES

- In Windows, `Restart-Computer` uses the [Win32Shutdown method](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem)
of the Windows Management Instrumentation (WMI) [Win32_OperatingSystem](/windows/desktop/CIMWin32Prov/win32-operatingsystem)
class. This method requires the **SeShutdownPrivilege** privilege be enabled for the user account
used to restart the machine.
- On Linux and macOS, `Restart-Computer` uses the `/sbin/shutdown` bash tool.
- In Windows, `Restart-Computer` uses the
[Win32Shutdown method](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem)
of the Windows Management Instrumentation (WMI)
[Win32_OperatingSystem](/windows/desktop/CIMWin32Prov/win32-operatingsystem) class. This method
requires the **SeShutdownPrivilege** privilege be enabled for the user account used to restart
the machine.
- This cmdlet was added for Linux and macOS in PowerShell 7.1. On Linux and macOS,
`Restart-Computer` uses the `/sbin/shutdown` bash tool.

## RELATED LINKS

Expand Down
16 changes: 12 additions & 4 deletions reference/7.4/Microsoft.PowerShell.Management/Stop-Computer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 05/15/2023
ms.date: 05/07/2025
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/stop-computer?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Stop-Computer
Expand All @@ -29,8 +29,9 @@ The `Stop-Computer` cmdlet shuts down the local computer and remote computers.
You can use the parameters of `Stop-Computer` to specify the authentication levels and alternate
credentials, and to force an immediate shut down.

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

## EXAMPLES

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

This parameter is only available on Windows platforms.

```yaml
Type: System.String[]
Parameter Sets: (All)
Expand Down Expand Up @@ -145,6 +148,8 @@ object and the password is stored as a [SecureString](/dotnet/api/system.securit
> For more information about **SecureString** data protection, see
> [How secure is SecureString?](/dotnet/api/system.security.securestring#how-secure-is-securestring).

This parameter is only available on Windows platforms.

```yaml
Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Expand All @@ -161,6 +166,8 @@ Accept wildcard characters: False

Forces an immediate shut down of the computer.

This parameter is only available on Windows platforms.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Expand Down Expand Up @@ -197,7 +204,8 @@ For more information about the values of this parameter, see
> increases the security risk of the remote operation. If the remote computer is compromised, the
> credentials that are passed to it can be used to control the network session.

This parameter was introduced in PowerShell 3.0.
This parameter was introduced in PowerShell 3.0. This parameter is only available on Windows
platforms.

```yaml
Type: System.String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ Restart-Computer [-WsmanAuthentication <String>] [[-ComputerName] <String[]>]

## DESCRIPTION

> **This cmdlet is only available on the Windows platform.**

The `Restart-Computer` cmdlet restarts the operating system on the local and remote computers.

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

In PowerShell 7.1, `Restart-Computer` was added for Linux and macOS. The non-Windows platforms only
have the **WhatIf**, **Confirm**, and **CommonParameters** parameters. The cmdlet is just calling
the native command `/sbin/shutdown`.

## EXAMPLES

## EXAMPLES

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

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

This parameter is only available on Windows platforms.

```yaml
Type: System.String[]
Parameter Sets: (All)
Expand Down Expand Up @@ -159,6 +165,8 @@ object and the password is stored as a [SecureString](xref:System.Security.Secur
> For more information about **SecureString** data protection, see
> [How secure is SecureString?](xref:System.Security.SecureString#how-secure-is-securestring).

This parameter is only available on Windows platforms.

```yaml
Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Expand All @@ -182,6 +190,8 @@ This parameter was introduced in Windows PowerShell 3.0.

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

This parameter is only available on Windows platforms.

```yaml
Type: System.Int16
Parameter Sets: (All)
Expand All @@ -206,7 +216,8 @@ The acceptable values for this parameter are:
- **WMI**: Receives a reply to a **Win32_ComputerSystem** query for the computer.
- **WinRM**: Can establish a remote session to the computer by using WS-Management.

This parameter was introduced in Windows PowerShell 3.0.
This parameter was introduced in Windows PowerShell 3.0. This parameter is only available on Windows
platforms.

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

Forces an immediate restart of the computer.

This parameter is only available on Windows platforms.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Expand All @@ -247,6 +260,8 @@ The **Timeout** parameter is only valid with the **Wait** parameter. **Timeout**

This parameter was introduced in Windows PowerShell 3.0.

This parameter is only available on Windows platforms.

```yaml
Type: System.Int32
Parameter Sets: (All)
Expand Down Expand Up @@ -274,7 +289,8 @@ The **Wait** parameter isn't valid when you're restarting the local computer. If
`Restart-Computer` generates a non-terminating error for **Wait** on the local computer, but waits
for the remote computers to restart.

This parameter was introduced in Windows PowerShell 3.0.
This parameter was introduced in Windows PowerShell 3.0. This parameter is only available on Windows
platforms.

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

This parameter is only available on Windows platforms.

```yaml
Type: System.String
Parameter Sets: (All)
Expand Down Expand Up @@ -378,7 +396,8 @@ This cmdlet returns no output.
[Win32_OperatingSystem](/windows/desktop/CIMWin32Prov/win32-operatingsystem) class. This method
requires the **SeShutdownPrivilege** privilege be enabled for the user account used to restart
the machine.
- On Linux and macOS, `Restart-Computer` uses the `/sbin/shutdown` bash tool.
- This cmdlet was added for Linux and macOS in PowerShell 7.1. On Linux and macOS,
`Restart-Computer` uses the `/sbin/shutdown` bash tool.

## RELATED LINKS

Expand Down
16 changes: 12 additions & 4 deletions reference/7.5/Microsoft.PowerShell.Management/Stop-Computer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 05/15/2023
ms.date: 05/07/2025
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/stop-computer?view=powershell-7.5&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Stop-Computer
Expand All @@ -29,8 +29,9 @@ The `Stop-Computer` cmdlet shuts down the local computer and remote computers.
You can use the parameters of `Stop-Computer` to specify the authentication levels and alternate
credentials, and to force an immediate shut down.

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

## EXAMPLES

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

This parameter is only available on Windows platforms.

```yaml
Type: System.String[]
Parameter Sets: (All)
Expand Down Expand Up @@ -145,6 +148,8 @@ object and the password is stored as a [SecureString](/dotnet/api/system.securit
> For more information about **SecureString** data protection, see
> [How secure is SecureString?](/dotnet/api/system.security.securestring#how-secure-is-securestring).

This parameter is only available on Windows platforms.

```yaml
Type: System.Management.Automation.PSCredential
Parameter Sets: (All)
Expand All @@ -161,6 +166,8 @@ Accept wildcard characters: False

Forces an immediate shut down of the computer.

This parameter is only available on Windows platforms.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Expand Down Expand Up @@ -197,7 +204,8 @@ For more information about the values of this parameter, see
> increases the security risk of the remote operation. If the remote computer is compromised, the
> credentials that are passed to it can be used to control the network session.

This parameter was introduced in PowerShell 3.0.
This parameter was introduced in PowerShell 3.0. This parameter is only available on Windows
platforms.

```yaml
Type: System.String
Expand Down
Loading