Automation

 View Only
  • 1.  Script to detach CD media always promts for action

    Posted Apr 25, 2013 03:50 PM

    I have created this script and am when run this always pormts for action to anser Y N A for the scipt to continue. What is the command to always answer the question with a yes ?

    get-cddrive -VM $vm |where {$_.ISOPATH -ne $null}|set-cddrive  -nomedia



  • 2.  RE: Script to detach CD media always promts for action
    Best Answer

    Posted Apr 25, 2013 03:56 PM

    You can use the -Confirm:$false parameter to prevent getting the confirmation question:

    get-cddrive -VM $vm |where {$_.ISOPATH -ne $null}|set-cddrive  -nomedia -Confirm:$false



  • 3.  RE: Script to detach CD media always promts for action

    Posted Apr 25, 2013 04:20 PM

    Thanks, didn't read the docs fully.