PowerCLI Reference

Set-VMQuestion

Synopsis

This cmdlet answers the specified virtual machine question.

Syntax

Set-VMQuestion -VMQuestion <VMQuestion[]> [-Option] <Object> [-WhatIf] [-Confirm] [<CommonParameters>]

Set-VMQuestion -VMQuestion <VMQuestion[]> -DefaultOption [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-VMQuestion

Detailed Description

This cmdlet answers the specified virtual machine question using the value of the Option parameter. If the DefaultOption parameter is set to $true, the cmdlet answers the question with a default option, if any.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
OptionObjectSpecifies an object or string to provide an option to the virtual machine question. Wildcards are supported for string values. The string can be used to specify an option ID or label. If the string does not match a valid option ID or label, or if there are multiple matches, an error is generated.truefalse
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse
DefaultOptionSwitchParameterIndicates that you want to answer the virtual machine question using a default option. If no default option exists for the question, an error is generated.truefalse
VMQuestionVMQuestion[]Specifies the virtual machine question you want to answer.truetrue (ByValue)
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

The modified VMQuestion object

Notes

You can also call this cmdlet via the Answer-VMQuestion alias.

Examples

-------------- Example 1 --------------

Set-VMQuestion -VMQuestion $question -DefaultOption

Answers the question stored in the $question with a default option.

-------------- Example 2 --------------

Set-VMQuestion -VMQuestion $question -Option "Cancel"

Answers the question stored in the $question variable with "cancel".

-------------- Example 3 --------------

Get-VM VM | Get-VMQuestion | Set-VMQuestion -DefaultOption

Answers the question of VM virtual machine with a default option.


Copyright © VMware, Inc. All rights reserved.