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
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
Thanks, didn't read the docs fully.