Use this command and fil the list.txt with the exact names of the VM's
Format
VM1
VM2
etc..
Get-CDDrive -VM (Get-Content C:\scripts\list.txt) | Set-CDDrive -nomedia
Or use this command to remove the media of ALL VM's
Get-CDDrive -VM * | Set-CDDrive -nomedia