will do the restart for you. if you want to know if its successful you'll need to either ping it to watch it disappear and comeback or check the event logs
by Ashtonnew at 2012-12-19 09:06:39
yes , thanks . How can I add in the script that the reboot were successful, I am adding get-content from a csv file with the list of computers to the script.
by DexterPOSH at 2013-02-27 08:06:38
I saw this thread after a long time....As pointed above by Richard Sir. After restarting the machine...you can use the cmdlet Test-Connection as below: Test-Connection -ComputerName servername -Count 2 -Quiet This will give you a True/False value which will probably go inside an if condition.
Hope this makes sense
by DonJ at 2013-02-27 08:10:44
In PowerShell v3, you can also use the -wait parameter of Restart-Computer.