Hello,
I would like to clear the description field of a VM. I use the command set-vm <vmname> -description "". The task finished successfully in the powershell console and in the VC, but nothing happens. What means the description field text is not changed. If I use the command (set-vm <vmname> -description "Hello World") to fill the description field, it works. Anyone a idea how to clear the description field?
Thanks
Markus
That option seems to be absent.
Until it is fixed you can use this script that uses the ReconfigVM method.
$vm = Get-VM -Name <VM-name> | Get-View $spec = New-Object VMware.Vim.VirtualMachineConfigSpec $spec.annotation = "" $vm.ReconfigVM($spec)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That option seems to be absent.
Until it is fixed you can use this script that uses the ReconfigVM method.
$vm = Get-VM -Name <VM-name> | Get-View $spec = New-Object VMware.Vim.VirtualMachineConfigSpec $spec.annotation = "" $vm.ReconfigVM($spec)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I can confirm this to be a minor bug. Setting it to " " (a space) will work. I'm sure there's a way to do it with the SDK but I don't have time to look for the right object right now. I tried this but the change did not take effect. I'm sure LucD can explain why not.
$vmview = get-vm foo | get-view $vmview.Config.Annotation = $null
@VMware--make the Description parameter nullable please...
Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)
I should've hit reload.
Author of the upcoming book: Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net)