Try something like this, but note that the Guest properties are only containing values when the VMware Tools are installed, and when the VM is powered on.
Get-Cluster -Server $global:DefaultVIServers -PipelineVariable cluster |
Get-VM |
select-object Name,Folder,Guest,PowerState,VMHost,PersistentId,Uid,
@{N='IP';E={$_.Guest.IPAddress -join '|'}},
@{N='FQDN';E={$_.ExtensionData.Guest.IPStack[0].DnsConfig.HostName,
$_.ExtensionData.Guest.IPStack[0].DnsConfig.DomainName -join '.'}}
The Get-View is a regular PowerCLI cmdlet, and it gives you access to the vSphere objects.
In short there are two types of objects when working with PowerCLI:
- the .Net objects are the ones that are returned by the PowerCLI cmdlets. For example the VirtualMachine object returned by Get-VM. These objects contain a selection, made by the PowerCLI Dev Team, of the corresponding vSphere object.
- the vSphere objects. These are documented in the API Reference, and are the actual objects that vSphere uses internally. An example is the VirtualMachine object. Notice how this vSphere object has much more properties than the corresponding .Net object.
With Get-View you can access the vSphere object from a .Net object.
For example:
Get-VM -Name MyVM | Get-View
You can also access the vSphere object through the ExtensionData property of the .Net object (which I used in the FQDN calculated property above.