2

When I run my power shell script, I got the following error: My question is why I am getting such errorr? char:13 is $ in $results, that is the return value of what I call, why I am getting a 'can't call null-value expression'?

You cannot call a method on a null-valued expression.
At C:\test.ps1:79 char:13
+             $results = ($content -match "MyValues" -split "=")[1].Tr ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
n179911
  • 19,547
  • 46
  • 120
  • 162

0 Answers0