mkellerman / Invoke-CommandAs

Invoke Command As System/Interactive/GMSA/User on Local/Remote machine & returns PSObjects.

Home Page:https://www.powershellgallery.com/packages/Invoke-CommandAs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

You cannot call a method on a null-valued expression.

manikandanid opened this issue · comments

I am getting the following error while running the command

You cannot call a method on a null-valued expression.
At S:\Philips\Apps\iSite\Tools\SHDBAutoDeployService\Sensors\Content\Invoke-CommandAs.psm1:194 char:59

  •             $UsingVariables = $ScriptBlock.ast.FindAll <<<< ({$args[0] -is [System.Management.Automation.Language
    

.UsingExpressionAst]},$True)
+ CategoryInfo : InvalidOperation: (FindAll:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

image

What version of Powershell are you running on?

$PSVersionTable

What version of the module are you running?

Get-Module -Name Invoke-CommandAs

And how did you install the module? from the Powershell Gallery? or from GitHub?

My version is 2.0

image

I just d/w the psm1 to local path where my other scripts are located and refrenced it via import module.

Sorry, you need v3 or higher

Thanks and please add the same info in set of system requirements. So that this does not occur. BTW your script is great and handy but i cant use it due to version mismatch.