Skip to content

Instantly share code, notes, and snippets.

@mikejgray
Created June 5, 2019 17:10
Show Gist options
  • Save mikejgray/e1e4ed6cd51ec731a1ca385e08f9b9e0 to your computer and use it in GitHub Desktop.
Save mikejgray/e1e4ed6cd51ec731a1ca385e08f9b9e0 to your computer and use it in GitHub Desktop.
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