Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $noshutdown = @("DC","vCenter","backup")
- $vms = (Get-Cluster -Name $clusterName | Get-VM | where {$_.Powerstate -eq "PoweredOn"})
- foreach ($vm in $vms)
- {
- if ($noshutdown -contains $vm.Name)
- {
- continue
- }
- else
- {
- $vm | Shutdown-VMGuest -Confirm:$false
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement