VMware Cloud Community
Glen_A
Contributor
Contributor

Do not confirm - Set-VM

I am trying to get my little one liner to run without asking for confirmation. I just want it to complete without stopping. Get-VM and Set-VM take long enough as it is..I cant figure out what I am doing wrong. I am new to PS so go easy on me.

$vcs = Connect-VIServer "vmw-VC -User "" -Password $Password

$Vmcreate = "vmstest-vt01"

$Cpu = "2"

$mem = "2048"

$Network = "10.127.24.0"

*

Set-Vm $VMcreate -MemoryMB $mem -NumCpu $cpu | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName $Network -StartConnected $false

Any ideas? I tried using the -confirm $false but that didnt work. Maybe I am using it incorrectly.

Thank you*

*Glen

*

0 Kudos
2 Replies
halr9000
Commander
Commander

You have to put a colon after Confirm.

set-vm -confirm:$false

--

$signature = "Hal Rottenberg, MVP - PowerShell"

$projects = @{ title = "Blog Author"; url = "http://halr9000.com" },

@{ title = "Co-host"; url = "http://powerscripting.net" },

@{ title = "Community Director"; url = "http://PowerShellCommunity.org" },

@{ title = "Psi Webmaster"; url = "http://psi-im.org" }

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
Glen_A
Contributor
Contributor

Thanks.. man right when I think I am getting it.. I miss something like

this..

Glen

 

Glen E. Adkins II

VMware Enterprise Admin

Server Support/Engineering

Phone:(614)-293-0731

Pager:(614)-346-4195

Glen.AdkinsII@osumc.edu

0 Kudos