Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

You cannot call a method on a null-valued expression

$
0
0

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


Viewing all articles
Browse latest Browse all 175326

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>