@@ -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-
3028The ` Restart-Computer ` cmdlet restarts the operating system on the local and remote computers.
3129
3230You 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
3836available on the restarted computer. This feature makes it practical to use ` Restart-Computer ` in
3937scripts 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.
109113Kerberos authentication determines whether the current user has permission to restart the remote
110114computer. For more information, see
111- [ AuthenticationMechanism] ( /dotnet/api/system.management.automation.runspaces.authenticationmechanism ) .
115+ [ AuthenticationMechanism] ( xref:System.Management.Automation.Runspaces.AuthenticationMechanism ) .
112116
113117``` powershell
114118Restart-Computer -ComputerName Server01 -WsmanAuthentication Kerberos
@@ -132,6 +136,8 @@ if your computer isn't configured to run remote commands.
132136
133137If 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
136142Type : System.String[]
137143Parameter Sets : (All)
@@ -152,12 +158,14 @@ Type a user name, such as **User01** or **Domain01\User01**, or enter a **PSCred
152158generated by the ` Get-Credential` cmdlet. If you type a user name, you're prompted to enter the
153159password.
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
163171Type: System.Management.Automation.PSCredential
@@ -182,6 +190,8 @@ This parameter was introduced in Windows PowerShell 3.0.
182190
183191If 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
186196Type: System.Int16
187197Parameter 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
212223Type: Microsoft.PowerShell.Commands.WaitForServiceTypes
@@ -225,6 +236,8 @@ Accept wildcard characters: False
225236
226237Forces an immediate restart of the computer.
227238
239+ This parameter is only available on Windows platforms.
240+
228241` ` ` yaml
229242Type: System.Management.Automation.SwitchParameter
230243Parameter Sets: (All)
@@ -247,6 +260,8 @@ The **Timeout** parameter is only valid with the **Wait** parameter. **Timeout**
247260
248261This parameter was introduced in Windows PowerShell 3.0.
249262
263+ This parameter is only available on Windows platforms.
264+
250265` ` ` yaml
251266Type: System.Int32
252267Parameter 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
275290for 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
280296Type: System.Management.Automation.SwitchParameter
@@ -297,7 +313,7 @@ The acceptable values for this parameter are: **Basic**, **CredSSP**, **Default*
297313**Kerberos**, and **Negotiate**.
298314
299315For 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
310328Type: System.String
311329Parameter Sets: (All)
@@ -355,7 +373,8 @@ Accept wildcard characters: False
355373
356374This 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
0 commit comments