I’ve got a process that runs a local script via Invoke-Expression without issue. However if I move the script to a network share and input the new location, receive an error indicating a cast error as shown below;
I’ve tried passing the path as a variable as well as hard coding it in UIPath Invoke-PowerShell Activity argument to no avail. If I run the same command/script as per below direct in PowerShell there is no error.
Oh also, if you still get the error, then it might be coming from the “Set-DefaultPrinterFinance.ps1” file. You could also look up that error online to seek out solutions that may help if we can’t.