Hi
I’m looking for some help to fine my attempt to write a quick PowerShell script when using PowerCLI connected to my firms VMWare cluster.
I’m looking to get a list of all Virtual Machines that are domain joined, list by GuestOS type i.e. Windows and then add a label to an existing Custom Attribute.
So far this is what i have come up with to list the VMs.
(Get-VM).where{$_.PowerState -eq ‘PoweredOn’
-and $.Guest.OSFullName -match ‘Windows’}
I’ll need to add a write to everyhost where Guess.OSFullName is Windows with a named label to the Custom Attribute called xyz.