Hi LucD
Needed some help. with the attached script I am getting some errors and the macaddress being collected in the output is getting prefixed as follows. any help is highly appreciated.
Macaddress -->
Line 92 of the script.
output is:
VMMac == @{MacAddress=00:50:56:93:46:10}
errors i am getting
Exception calling "Join" with "2" argument(s): "Value cannot be null.
Parameter name: value"
At U:\Scripts\VMInventory-v4.ps1:47 char:50
+ $Report.vNicType = &{if($_.Guest){[string]::Join <<<< (',',($vm.NetworkAd
apters | %{$_.Type}))}}
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Exception calling "Join" with "2" argument(s): "Value cannot be null.
Parameter name: value"
At U:\Scripts\VMInventory-v4.ps1:58 char:52
+ $Report.GuestDisks = &{if($_.Guest){[string]::Join <<<< (',',($_.Guest.Di
sks | %{$_.Path}))}}
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Attempted to divide by zero.
At U:\Scripts\VMInventory-v4.ps1:62 char:130
+ $Report.GuestDiskspaceUsed = &{if($_.Guest){[string]::Join(',',($_.Guest.
Disks | %{"{0:p0}" -f (($_.Capacity - $_.FreeSpace)/ <<<< $_.Capacity)}))}}
+ CategoryInfo : NotSpecified: (:) [], RuntimeException
+ FullyQualifiedErrorId : RuntimeException
Exception calling "Join" with "2" argument(s): "Value cannot be null.
Parameter name: value"
At U:\Scripts\VMInventory-v4.ps1:62 char:63
+ $Report.GuestDiskspaceUsed = &{if($_.Guest){[string]::Join <<<< (',',($_.
Guest.Disks | %{"{0:p0}" -f (($_.Capacity - $_.FreeSpace)/$_.Capacity)}))}}
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Exception calling "Join" with "2" argument(s): "Value cannot be null.
Parameter name: value"
At U:\Scripts\VMInventory-v4.ps1:47 char:35
+ $Report.vNicType = [string]::Join <<<< (',',($vm.NetworkAdapters | %{$_.T
ype}))
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException