As a system administrator, there are times when you need to schedule a restart for server maintenance. While PowerShell’s Restart-Computer
cmdlet is handy, it doesn’t offer a built-in parameter for timing the shutdown. This means you’d typically need to combine it with New-ScheduledTask
, which is only available in PowerShell 3.0 and later.
But let’s keep it simple. Instead of relying on newer PowerShell features, you can use the built-in shutdown.exe
utility. By combining shutdown.exe
with a PowerShell command, you can easily schedule a restart.