Resolution when the Invoke PowerShell activity works on Windows Legacy, but it does not work in Windows compatibility projects.
Issue Description: Error is thrown while running a Python script using Invoke Power Shell in UiPath. Same script runs successfully on Windows Legacy projects and from local PowerShell 32 and 64 runs, but it fails when it s run with Windows compatibility project.
Resolution: When running a script via Invoke PowerShell, before the Invoke Python script activity, that will non-persistently modify the execution policy for Microsoft.PowerShell.SDK 7.1, fixes the issue:
$A = Set-ExecutionPolicy Unrestricted -Scope Process
I’m experiencing the same problem: Invoke Power Shell doesn’t work for me after converting a project from Windows-Legacy to Windows. The error is the generic “Invoka Power Shell: The term ‘XXXXXXXXXXXXXXXX’ is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.”, but the term is the same that’s working in the “legacy” version of the project.
The “resolution” text is not understandable; it mentions something about a “Invoke Python” activity, and then the rest is written in poor English.
Can you please clarify?
I tried executing what you said prior to the PowerShell command that’s not being recognized, and in fact the output of that one is ok, but then the error still happens.