VMware Cloud Community
manfred9999
Contributor
Contributor
Jump to solution

Retrieve available hostdevice strings to use it in Set-CDDrive -hostdevice

Hello

I try to find the available CD-Rom hostdevices in the Virtual Machine hostregistration. If you set the CDRom connection in the vSphere client this strings are listed in the Host Device Type.

Regards

Manfred

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

One way of doing this would be like this

$vm = Get-VM <VM-name> | Get-View
$esx = Get-View $vm.Runtime.Host
$envBrowser = Get-View (Get-View $esx.Parent).environmentBrowser
$configTgt = $envBrowser.QueryConfigTarget($esx.MoRef)
$configTgt.CdRom | %{$_.Name}


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

One way of doing this would be like this

$vm = Get-VM <VM-name> | Get-View
$esx = Get-View $vm.Runtime.Host
$envBrowser = Get-View (Get-View $esx.Parent).environmentBrowser
$configTgt = $envBrowser.QueryConfigTarget($esx.MoRef)
$configTgt.CdRom | %{$_.Name}


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

0 Kudos
manfred9999
Contributor
Contributor
Jump to solution

LucD thank you a lot!

Regards

Manfred

0 Kudos