Automation

 View Only
  • 1.  Enable 3D support with power cli

    Posted Jun 20, 2016 07:17 AM

    Hello everybody

    How do I can enable 3D support with power cli for all virtual machines?

    regard

    Hamid Reza Danehchin



  • 2.  RE: Enable 3D support with power cli
    Best Answer

    Posted Jun 20, 2016 08:56 AM

    Try like this

    $vmName = 'MyVM'

    $vm = Get-View -ViewType VirtualMachine -Filter @{'Name'="^$($vmName)$"}

    $spec = New-Object VMware.Vim.VirtualMachineConfigSpec

    $dc = New-Object VMware.Vim.VirtualDeviceConfigSpec

    $dc.Operation = 'edit'

    $dev = $vm.Config.Hardware.Device | where{$_ -is [VMware.Vim.VirtualMachineVideoCard]}

    $dev.enable3DSupport = $true

    $dc.Device += $dev

    $spec.DeviceChange += $dc

    $vm.ReconfigVM($spec)