Page 1 of 1

Bug with new versions of Powershell

Posted: Fri Sep 16, 2022 11:05 am
by DK.Ideagen
If I run a powershell script and set the path to powershell to pwsh ie use powershell core the newest version I get an invocation error despite powershell core working perfectly everywhere else.

I have tried ms store, scoop and direct install types of Powershell version 7.2.6 all fail

Re: Bug with new versions of Powershell

Posted: Tue Sep 20, 2022 6:32 am
by Oleg
"pwsh" is not a path...
You must specify the full path to installed powershell application
Like this:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Re: Bug with new versions of Powershell

Posted: Tue Sep 20, 2022 6:44 am
by Oleg
Also I think that you have incorrect installation of Powershell application
I tried to download new powershell from MS Store, it works (see screenshot)
pwsh.png
pwsh.png (23.86 KiB) Viewed 1953 times

Re: Bug with new versions of Powershell

Posted: Tue Sep 20, 2022 9:47 am
by DK.Ideagen
Discovered my problem I had a
cls
command at the top of my $profile
to clear the screen
this ran a function to get the mouse cursor which robotask failed on.

Re: Bug with new versions of Powershell

Posted: Tue Sep 20, 2022 11:42 am
by Oleg
I think that cls command has no sense in Powershell script action, because this action has no UI at running...

Re: Bug with new versions of Powershell

Posted: Tue Sep 20, 2022 11:52 am
by DK.Ideagen
You are correct, However the cls command was coming from my $profile script which runs on every powershell session like a .rc file on linux.
This includes RoboTask.

I have removed the offending line from my profile anyway. So problem worked around and debugged. :)