Restart-Computer
Use Restart-Computer to restart the local computer or a remote one by name; -WhatIf shows the target without restarting, and -Wait blocks until a remote Windows endpoint responds again.
Documentation: Microsoft Learn — Restart-Computer
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Restart-Computer [-ComputerName <String[]>] [-Credential <PSCredential>] [-Wait] [-For PowerShell] [-Timeout <Int32>] [-Delay <Int16>] [-WhatIf] [-Confirm]- Stage 1Restart-Computer
-ComputerName -Credential -Wait -For -Timeout -Delay -WhatIf -Confirm
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Restart-Computer -ComputerName Server01
Show reference output
Sample output · fictional data, shaped like the real thing
(No output — the computer restarts. Reconnect and run Get-Uptime to verify.)
Parameters
Parameter definitions:
-ComputerName-Credential-Wait-For-Timeout-Delay-WhatIf-Confirm
Practical use and troubleshooting
Practical scenario: Use Restart-Computer when you need to restart a local or remote computer with Restart-Computer. Preview targets with -WhatIf and use -Wait for remote Windows systems. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: Access denied or transport errors on a remote restart require appropriate rights and connectivity. Confirm the exact computer and approved maintenance window before retrying. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Restart-Service. Restart-Computer restarts an operating system; Restart-Service restarts one service. Review the broader impact before using a computer restart to repair an isolated service problem. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Recap
Restart-Computer Use Restart-Computer to restart the local computer or a remote one by name; -WhatIf shows the target without restarting, and -Wait blocks until a remote Windows endpoint responds again.
Next: Restart-Service