I have a script to unmount the CD-ROM/ISO for a list of VMs. It works well but will hang for VMs that get a question about "override the lock" to disconnect it. I can answer this Set-VMQuestion but since the script is hung up on the Set-CDDrive command, I am stuck. How can I get past this issue? This is the command I am using the unmount the ISO.
Set-CDDrive -CD $cd -NoMedia -Confirm:$false