Created
June 5, 2019 17:10
-
-
Save mikejgray/e1e4ed6cd51ec731a1ca385e08f9b9e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach ($server in ("SERVER1", "SERVER2")) { | |
Restart-Computer -ComputerName $server -Force | |
do { | |
$Ping = Test-Connection -ComputerName $server -Count 1 -Quiet | |
} until ($Ping -eq $True) | |
Write-Host -ForegroundColor "Green" "$($server) is up" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment