VMware Cloud Community
madhav023
Contributor
Contributor

PowerCLI Script to unmount CD Drive from Datastore ISO.

Hi Experts,

Actually am working to make script to unmount CD Drive from Datastore ISO's but its asking Question option like Yes or No.I have used below command to unmount. But what i need is I want to unmount CD Drive Datastore which ISO's are mounted older than 7 days.

Get-VM _Name vm-test | Get-CDDrive | where { $_.ISOPath -like $ISO } | Set-CDDrive -Nomedia -confirm:$false | Get-VMQuestion | Set-VMQuestion –Option "Yes"

I have used this command to unmounting, its unmounting but asking Question even i have mention option. Also i want to unmount only ISO's ar emounted older than 7 days.

If any one knows kindly help.

Thanks In advance.

0 Kudos
1 Reply
LucD
Leadership
Leadership

For the question part, have a look at the technique I show in Answer the question!


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos