At our company we needed a simple script to update our VMs Annotations - It's not the best script ever but it works and I'd like to share it with the community: # csv: VirtualMachine,Annotatio...
See more...
At our company we needed a simple script to update our VMs Annotations - It's not the best script ever but it works and I'd like to share it with the community: # csv: VirtualMachine,Annotation,Value # Load vmWare vSphere PowerCLI Module Add-PSSnapin VMware.VimAutomation.Core # Connect to vCenter Connect-VIServer <vCenter> -User <user> # Import CSV and Set Annotations Function VM-Selection { $vms = @() Import-Csv C:\vmware.csv | %{$vms += (Get-VM -Name $_.VirtualMachine | Set-Annotation -customattribute $_.Annotation -Value $_.Value) } return $vms } VM-Selection There are probably snipplets where you can find something similar - thanks for their great work!