In the Settings–>General screen I’ve set my PowerShell version path to Version 7 as “C:\Program Files\PowerShell\7\pwsh.exe”. But, when I run scripts, they indicate that they’re running as version 5.1. I deleted all paths except for version 7, it’s the only entry, yet when I run scripts it’s still saying they’re running as 5.1.
Another weird thing is that the drop down on the Execution Options screen for script execution shows “1” (which is an invalid entry, I don’t have a PowerShell version by that name) and I have to manually select “7”. This seems to be a bug where it’s defaulting to some invalid value and not switching to the other option, and proceeding with the invalid option and then for whatever reason failing back to PS 5.1.
The scripts I have were written for PowerShell 7, so they’re failing.
Can you let me know what version of PS Universal you’re running? This is defintiely a bug with the UI.
You can always update your scripts.ps1 in C:\ProgramData\UniversalAutomation.universal to use the correct PowerShell version by adding the -PowerShellVersion parameter and providing the name.
In C:\ProgramData\UniversalAutomation.universal\scripts.ps1 I found this parameter specified for the specific script that I was unable to switch to PS version 7: -RequiredPowershellVersion “5.1”. Removing this allowed me to manually execute the script in Automation under PS7. I have no idea how that parameter got there. But now I’m able to select and run PS7.
One issue that’s still there, seems like a bug: The two versions I have listed within settings are ‘5.1’ and ‘7’, yet the default version to run scripts as is ‘1’.