Run Power Shell Script Activity - unable to run PS script


I hope you can help, I’m trying to use Run Power Shell Script activity to run a simple power-shell script, and this is throwing me the following error below:

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.InvalidOperationException: The activity ‘Run power shell script’ with ID 3 threw or propagated an exception while being canceled. ----> System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Cast[TResult](IEnumerable source)
at UiPath.Script.Activities.PowerShell.RunPowerShellScript`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
— End of inner ExceptionDetail stack trace —

Would it be some kind of permissions issue on my local PC even though the directory where the PS.1 is stored has full rights and when i run the PS.1 manually it works fine with out any prompt about permissions.


@Jchizzel168 - Could you post your XAML file? I think you are not setting an argument to a value before using it.

Hi Sreenivasm,

There isn’t much to it, but here you go :

@Jchizzel168 - Are you passing any arguments in the (Collection) under Input->Parameters?

Ahh maybe this is where i went wrong, let me read up on it. Thanks for the pointers

to get around it, I used Read Text File and then followed by a Invoke powershell .