I want to automate test using powershell. I want to write a script to shutdown the computer, wait for 3minutes and then power on the computer. Is it possible using Powershell? I know that reboot is possible, but I want the system to remain in shutdown stage for 3min and then power on.
2 Answers
If you mean a "real computer" (not a Virtual Machine) so it's not possible. But you can achieve that using Virtual Machine setup. Take look at this documentation: https://technet.microsoft.com/en-us/library/hh848589.aspx
Comments
- You can shutdown computer with
Stop-Computercommand - Wait with
Start-Sleep - But to poweron PC you need something more complex, take a look at
WOL. However there are some difficulties:- It would work only with PCs that allow to be awakened with magic packets
- You need to know MAC-address of machine
- Target machine should be in the current network subnet of the caller.