Do you want to know how to reboot Windows computer using PowerShell . This post explains how to use the command restart-computer
to trigger reboot from powershell CMD.
Reboot Windows from PowerShell
- Open PowerShell prompt by running
powershell
from cmd. - Run the below command which reboots Windows without asking user for any confirmation.
restart-computer
Reboot with user confirmation
If you want the user to confirm if reboot is required, then use -Confirm
argument.
restart-computer -Confirm
Example Run:
PS C:\> restart-computer -Confirm Confirm Are you sure you want to perform this action? Performing the operation "Enable the Local shutdown access rights and restart the computer." on target "localhost (local-pc)". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): N PS C:\>
Can a non-admin user run this command and reboot windows
I should think so, if by “admin” you mean someone not running Powershell in system/32 mode… But then, it might also depend on administrator settings. I would also like to have a definitive answer to this question.