Hi All,
Could anyone recommend a script for shutting-down vm's (gracefully) by taking the vm names from a file and then powering them off in that order.
I dont want to do this on a per host/VC level, it needs to be in a particular order.
Thanks!
Does this do the trick.
The file should contain a name per line
Get-Content "C:\vms.txt" | %{ Get-VM -Name $_ | Shutdown-VMGuest -Confirm:$false
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Does this do the trick.
The file should contain a name per line
Get-Content "C:\vms.txt" | %{ Get-VM -Name $_ | Shutdown-VMGuest -Confirm:$false
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference