Delayed restart of your computer using PowerShell

So I hate setting up Schedule Tasks in Windows for one time events. These one time events are mostly restarts of servers. Instead, what I will do is RDP into the server that needs to be restarted, open PowerShell as administrator and use the start-sleep command with a semicolon after it. In the example below, I have set the server to reboot in 1 hour. The numbers after the start-sleep command are seconds. That is where I got 3600 seconds from. Basically what start-sleep does is pause the process for the number of seconds that you specify. The semicolon is like having another line in the code so it will execute what is next, which in this case is restart-computer. Since you may not be logged into the server or it may be at a lock-screen, you will need to include the -confirm:$false otherwise it may not execute.

The reason I RDP into the server that needs the task is that if for some reason the server gets rebooted before my scheduled time, my current RDP session will be killed and the start-sleep reboot won't happen.

Start-Sleep 3600 ; Restart-Computer -Confirm:$false