jeffbrown
Contributor
Contributor

Turn off confirmation when changing CPU and Memory?

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

0 Kudos
3 Replies
LucD
Leadership
Leadership

Did you try adding –confirm:$false ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jeffbrown
Contributor
Contributor

Thank you for your help. This answered my question.

0 Kudos
halr9000
Commander
Commander

Incidentally, this is well documented here: http://blogs.msdn.com/powershell/archive/2006/12/15/confirmpreference.aspx

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos