The VLANid is not available in that object, you will have to fetch the VirtualPortgroup.
Try like this
Get-DataCentertestdata|Get-Clustertest|
Get-VM|
ForEach-Object {
$ErrorActionPreference='silentlycontinue'
$VM=$_
$VM|Get-VMGuest|Select-Object-ExpandPropertyNics|
ForEach-Object {
$Nic=$_
$vlan=Get-VirtualPortgroup-Name$nic.NetworkName -VM$VM
foreach ($IPin$Nic.IPAddress)
{
if ($IP.Contains('.'))
{
""|Select-Object-Property @{Name='VM';Expression={$VM.Name}},
@{Name='IPAddress';Expression={$IP}},
@{Name='NetworkName';Expression={$Nic.NetworkName}},
@{Name='VLANID';Expression={$vlan.VLanId}}
}
}
}
}