Automation

 View Only
Expand all | Collapse all

Remove-Harddisk -confirm $false woes

  • 1.  Remove-Harddisk -confirm $false woes

    Posted Aug 15, 2011 09:46 AM

    Hi,

    Have some issues getting this working (4.1 u1); I was wondering if some soul could help.

    Remove-HardDisk -whatif -confirm $false -HardDisk (Get-HardDisk -VM vTest2 | ?{$_.Name -eq "Hard disk 2"})

    This is my code at the moment (above), I am trying to get the -confirm set to $false as per document: http://www.vmware.com/support/developer/PowerCLI/PowerCLI41/html/Remove-HardDisk.html

    I can get it working just fine without the -confirm $false, but it prompts me for a 'are you sure y/n' type dialouge; as I need to run this in a script I have to disable the confirmation.  Please can someone help me out with what I am missing?

    For reference I pulled the code from here:

    http://communities.vmware.com/thread/315086

    Thanks!

    Leon.



  • 2.  RE: Remove-Harddisk -confirm $false woes
    Best Answer

    Posted Aug 15, 2011 09:47 AM

    That should be -Confirm:$false



  • 3.  RE: Remove-Harddisk -confirm $false woes

    Posted Aug 15, 2011 09:53 AM

    Thanks!