How to pass a parameter in Powershell script in UiPath?

@kkpatel ,

Looks like there is some kind of a Bug in Invoke Powershell Activity.

Comment the Invoke Powershell you have created. Drag another Invoke Powershell Activity. Use the Command Below :

Copy-Item -Path $SourceFile -Destination $DestnPath

I don’t think there is a Need of -PassThru

Keep the IsScript enabled.

Make sure that you Configure the Powershell Variables in One Shot.

The reason Is I think the Powershell Activity is again referring to the Old Values which once had provided the error. It seemed to be the case at my End.

However, if at first, we do Proper Configurations, then we shouldn’t receive such errors.

2 Likes