Snippet: Show vCenter On VM Object

If you regularly work with multiple vCenters it may help to create a custom property to denote the vCenter name on VMs:

New-VIProperty -Name vCenterServer -ObjectType VirtualMachine -Value {$Args[0].Uid.Split(":")[0].Split("@")[1]} -Force

I especially like this helper if I need to export data from multiple vCenters into a human-consumable format like CSV.