Custom Powershell script fails with Error but when execute from MID Server powershell console works as expected.Issue Custom Power-shell script fails with below Error but when execute from MID Server power-shell console works as expected. The argument is null. Provide a valid value for the argument, and then try running the command again. HRESULT: [-2146233087] ReleaseALLCauseThe Parameter passed in the Mid Server script file to check the path exits or not , the values should also be passed. Example script where we are passing the parameters username and group name , but the account is not passed , then the execution fails with the mentioned error if (test-path env:\SNC_accountName {$user =$env:SNC_userName;$group = $env:SNC_groupNmae;} ResolutionYou can pass the any parameters which you are passing to execute the script as below if (test-path env:\SNC_userName {$user =$env:SNC_userName;$group = $env:SNC_groupNmae;} Related LinksThe Line "if (test-path env:\SNC_userName "in the Script checks whether the provided file/path exits or not.