PowerShell task always failing

Nov 8, 2011 at 9:09 PM
Edited Nov 9, 2011 at 9:34 PM

If I execute my PowerShell task using InvokeProcess, I have no problems (though any errors look sloppy because they span lines). When I swap to using the PowerShell task in these extensions, I consistently get the error: "You cannot call a method on a null-valued expression."

I've never seen this error while developing or running my scripts elsewhere, so perhaps I'm not using this task properly. I'm executing from a file and passing in arguments. I ever tried signing the scripts to see if that would help, but no luck.

Has anyone else gotten this error only when using the extensions PowerShell task? Any help would be appreciated.

EDIT: Actually what I seem to have discovered is that the Arguments somehow do not get passed.

Nov 9, 2011 at 9:51 PM

Well, I seem to have solved my own problem. I was assuming the Arguments field was equivalent to Parameters, when I should have been appending the parameters to the Script property as a string. Problem solved!

May 7, 2014 at 12:12 PM
Hi Matt

Im seeing the same issue here; can you give me an example of the property settings that you used?