When running set-vm cmdlet, it is prompting me to confirm the action. This confirmation should only happen when I pass the -confirm flag. How can I get around this, so I can have it run as a schedule task with no one watching it.
PS I:\> set-vm $v -MemoryMB 2048 -NumCPU 2
Confirmation
Proceed with update of the following parameters of virtual machine with name
'PSAWHB20080305'?
New MemoryMB: 2048MB
New NumCPU: 2
Yes Yes to All No No to All Suspend Help
(default is "Y"):?
Y - Continue with only the next step of the operation.
A - Continue with all the steps of the operation.
N - Skip this operation and proceed with the next operation.
L - Skip this operation and all subsequent operations.
S - Pause the current pipeline and return to the command prompt. Type "exit" to
resume the pipeline.
Yes Yes to All No No to All Suspend Help
(default is "Y"):Y
Did you try adding –confirm:$false ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you for your help. This answered my question.
Incidentally, this is well documented here: http://blogs.msdn.com/powershell/archive/2006/12/15/confirmpreference.aspx