How do I run disconnect-viserver with no prompt in PowerCLI

31,800
disconnect-viserver -confirm:$false

As you notice, omitting the Confirm parameter is equivalent to -Confirm:$true

Share:
31,800
Chris F
Author by

Chris F

I'm a professional software developer by day, dad/husband by night, and a performing musician on some weekends. I love ALL DevOps - it's not a job, it's my passion!

Updated on April 11, 2020

Comments

  • Chris F
    Chris F about 4 years

    How can I disable the prompt when using the following cmdlet to disconnect from a server in PowerCLI? The help file shows a -Confirm option, which I don't use, so I'm inferring from this that without it, there should be NO prompt, but I still get prompted?

    disconnect-viserver -server MyServer

    Thanks

  • lantrix
    lantrix over 8 years
    I had been trying the standard powershell -Force but getting nowhere. I wonder if this is a PowerCLI specific switch.