Dear Lucd,
Script Which posted i excuted on our setup, From that i able to get the of Name, VlanID and NetworkStatus, But not able to get the values of Hostname and DSCapacity.
################### ERROR ########################
Exception calling "Join" with "2" argument(s): "Value cannot be null.
Parameter name: value"
At C:\test.ps1:10 char:66
+ $Details | Add-Member -Name DSCapacity -Value ([string]::Join <<<< (';',($vm.Extensiondata.Datastore | %{Get-View $_} | %{"{0:f1}" -f ($_.Summary.Capacity/1MB)}))) -Membertype NoteProperty
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Get-View : Cannot validate argument on parameter 'Id'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.
At C:\test.ps1:9 char:54
+ $Details | Add-Member -Name Host -Value (Get-View <<<< $vm.Extensiondata.Runtime.Host).Name -Membertype NoteProperty $Details | Add-Member -Name Datastore -Value ([string]::Join(';',($
+ CategoryInfo : InvalidData: (:) [Get-View], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.Commands.DotNetInterop.GetVIView
Get-View : Cannot validate argument on parameter 'Id'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.
At C:\test.ps1:10 char:112
+ $Details | Add-Member -Name DSCapacity -Value ([string]::Join(';',($vm.Extensiondata.Datastore | %{Get-View <<<< $_} | %{"{0:f1}" -f ($_.Summary.Capacity/1MB)}))) -Membertype NoteProperty
+ CategoryInfo : InvalidData: (:) [Get-View], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.Commands.DotNetInterop.GetVIView
Exception calling "Join" with "2" argument(s): "Value cannot be null.
Parameter name: value"
At C:\test.ps1:10 char:66
#############################################
The out put
Name : Windows 2003 Template
Networkstatus : False
VlanId : 0