- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The vCenter Server name is in the Uid property. You can use the string Split() method to extract the vCenter Server name:
Get-VM | Select-Object Name,@{N="vCenter";E={$_.Uid.Split('@')[1].Split(':')[0]}} Get-VMHost | Select-Object Name,@{N="vCenter";E={$_.Uid.Split('@')[1].Split(':')[0]}}
Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition