Auto reconnect to a server you just rebooted with PowerShell 3.0

January 8, 2012

Yesterday I saw a tweet that caught my eye: Sounds familiar? What do you usually do to reconnect to your server once it is back online? How do you monitor it’s availability? In this post, Justin shares a great function (115 lines) that restarts a server, waits for it to come back online and then starts a remote desktop connection to it. Now, what if I told you that in PowerShell 3.0 you can replace that function with only two lines of code? In PowerShell 3.0, the Restart-Computer cmdlet got improved (mainly to support Workflow scenarios) and it now supports...