Created
September 6, 2011 10:31
-
-
Save jbarber/1197216 to your computer and use it in GitHub Desktop.
List all VMs with questions (these block their running)
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
# Find the VMs with questions | |
$vms = get-view -viewtype virtualMachine | ?{ $_.runtime.question } | |
# Answer the questions | |
foreach ($vm in $vms) { | |
Get-VM $vm.name | Get-VMQuestion | Set-VMQuestion -DefaultOption | |
} | |
# You could also do this, but Get-VMQuestion seems to be *very* slow: | |
$questions = Get-VMQuestion | |
foreach ($question in $questions) { | |
Set-VMQuestion -VMQuestion $question -DefaultOption | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment