Hi,
please help as I am getting the below error,
You cannot call a method on a null-valued expression.
At D:\myreports\Free_LUNs_Info.ps1:54 char:11
+ $key = $esxImpl.ExtensionData.config.Network.DnsConfig.Hostname + "-" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Index operation failed; the array index evaluated to null.
At D:\myreports\Free_LUNs_Info.ps1:59 char:11
+ $scsiTab[$key] = $_.CanonicalName,"",$capacityGB,$lunId,""
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArrayIndex
Hereby attached the script
PowerCLI Version
----------------
VMware PowerCLI 11.2.0 build 12483598
---------------
Component Versions
---------------
VMware Cis Core PowerCLI Component PowerCLI Component 11.2 build 12483642
VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 11.2 build 12483638