VMware PowerCLI

The Best User Interface for your VMware Datacenter!

Set Video Memory on VM - Enrich PowerCLI to avoid PowerShell scriptlets

similar to https://powercli.ideas.aha.io/ideas/PCLI-I-246

Currently there are so many great cmdlets for PowerCLI but often large customers are forced to rely on API calls and Powershell scriptlets. We have to jump from cmdlets to scriptlets back and forth again and again. Please provide consistent cmdlets offered by PowerCLI without having to revert back to API calls to manage five digit VM numbers on daily basis.

Use Case:

  • change video memory

Set-VMVideoMemory -VM $servers -MemoryMB 4000 -AutoDetect $false

  • cmdlet (above) does not work any more but API:

$vid = $_.ExtensionData.Config.Hardware.Device | ?{$_.GetType().Name -eq "VirtualMachineVideoCard"}

$spec = New-Object VMware.Vim.VirtualMachineConfigSpec

$devChange = New-Object VMware.Vim.VirtualDeviceConfigSpec

$devChange.Operation = 'edit'

$vid.VideoRamSizeInKB = 4MB/1KB

$devChange.Device += $vid

$spec.DeviceChange += $devChange


  • Markus Struck
  • Nov 9 2020
  • Looking for Feedback
  • Attach files
  • Damon Jacobs commented
    13 May, 2021 07:03am

    Thanks for your good post