Reply to Message

View discussion in a popup

Replying to:
BGONZALES_ASH
Contributor
Contributor

Thanks Luc! I was able to do what I needed, I get an error on -Name when it runs on the first VM only, but it still works..

I'm need try and incorporate a VMtools version and Status check, then a reboot where needed..

Is there a way to pass along or link the Guest.State with the following objects in the If/and statement below? Appreciate your help Luc!

Guest.ToolsVersion

Guest.ToolsStatus

if($vm.Guest.State -eq "Running" -And $vm.NumCpu -ne '2' -And $vm.MemoryGB -ne '4'){

  Shutdown-VMGuest -VM $vm -Confirm:$false}

Reply
0 Kudos