Automation

 View Only
  • 1.  Tiny bug in Remove-VM

    Posted Mar 26, 2008 04:32 AM

    Unless I'm missing something, it appears like Remove-VM asks for confirmation regardless of specifying the -Confirm option or not.

    Fantastic tools by the way! I've been waiting a long time for this!

    Eric



  • 2.  RE: Tiny bug in Remove-VM

    Posted Mar 26, 2008 08:10 AM

    Did you use the option like this -confirm:$false ?

    See also http://communities.vmware.com/thread/130688?tstart=20.



  • 3.  RE: Tiny bug in Remove-VM

    Posted Mar 26, 2008 12:31 PM

    Check out this article by the powershell team on $confirmpreference. Short version is the cmdlet developer decides how much impact a given action will have, and they give that action a confirm threshold. You will be asked for confirmation depending on whether the action is higher or lower than the value of $confirmpreference.

    When you don't want to have to worry about this, it's best to manually specify $false as LucD mentioned.

    Hal Rottenberg

    Co-Host, PowerScripting Podcast (http://powerscripting.net)



  • 4.  RE: Tiny bug in Remove-VM

    Posted Mar 26, 2008 04:43 PM

    Fantastic! The -Confirm:$false parameter worked great.

    I'm not too familiar with PowerShell (yet). It's nice to see these messages coming from a "standard" shell response instead of having each cmdlet using its own custom approach to dealing with this type of thing.

    Thanks!

    Eric



  • 5.  RE: Tiny bug in Remove-VM

    Posted Mar 26, 2008 05:10 PM

    I'm not too familiar with PowerShell (yet). It's nice to see these messages coming from a "standard" shell response instead of having each cmdlet using its own custom approach to dealing with this type of thing.

    That, my friend, is the point of PowerShell. :smileyhappy:

    Hal Rottenberg

    Co-Host, PowerScripting Podcast (http://powerscripting.net)