Skip to content

Instantly share code, notes, and snippets.

@jbarber
Created September 6, 2011 10:31
Show Gist options
  • Save jbarber/1197216 to your computer and use it in GitHub Desktop.
Save jbarber/1197216 to your computer and use it in GitHub Desktop.
List all VMs with questions (these block their running)
# 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