PowerCLI

 View Only

 Running Scripts on VMware Cloud Director VMs

Chad Bryan's profile image
Chad Bryan posted Apr 03, 2025 11:44 AM

I would like to know if its possible to run an external script on a Cloud Director VM. Ive tried the following, but it gives me this error:


$scriptVM = Get-CIVM -Name $vApp

Invoke-VMScript -VM $scriptVm -ScriptText "dir" -GuestUser $username -GuestPassword $password


Error: Cannot bind parameter 'VM'. Cannot convert the "cb-win10-TEST5" value of type "VMware.VimAutomation.Cloud.Impl.V1.CIVMImpl" to type "VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine".