Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

You cannot call a method on a null-valued expression error? (powershell)

$
0
0
I have a null-valued expression error on this code that involves
microsofts dsf com objects but to my knowledge usually this means
i have a null variable somewhere:

You cannot call a method on a null-valued expression. At C:\Powershell\VMStartStop.ps1:31 char:35 + $result = $vmshut.InitiateShutdown <<<< ("$true","no comment")     + CategoryInfo          : InvalidOperation: (InitiateShutdown:String) [],    RuntimeException     + FullyQualifiedErrorId : InvokeMethodOnNull   unable to shutdown TEST_VM

Viewing all articles
Browse latest Browse all 15028

Trending Articles



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