PowerShell 7 not working after upgrade to 4.4.0

Hi.
Starting a new thread about a problem described here, it kinda drowned in a thread about something else.

The problem I’m having is that after an upgrade from PSU 4.2.13 to 4.4.0 suddenly nothing works in my Powershell 7 environment any more. My other environments (the integrated and one for Powershell 5) works like a charm, but my API endpoints use Powershell 7 by default so I’m kinda depending on it. If I try to start a terminal (using automation->terminals) with Powershell 7 it just says “Request failed with status code 500”, but I can’t find anything in any log telling me what’s really going wrong.

I have tried upgrading Powershell 7 on the server to latest (7.4.5) version and when I did that the version number for the environment in PSU changed to reflect the new version, so obviously it’s detected correctly by PSU.

Currently I’ve reverted to 4.2.13 (by going back to vmware server snapshot) where everything’s working, but I’d like ideas for what to try when I try upgrading again…

Pasting contents of my environments.ps1 below, nothing special about it:

New-PSUEnvironment -Name “Integrated” -Version “7.3.7” -Path “Universal.Server” -Variables @(‘‘)
New-PSUEnvironment -Name “Powershell 7” -Version “7.2.19” -Path “C:\Program Files\PowerShell\7\pwsh.exe” -Variables @(’
’)
New-PSUEnvironment -Name “Powershell 5” -Version “5.1.17763.6189” -Path "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe " -Variables @(‘*’)

Is that environments.ps1 output from 4.2.13 or how it looks after upgrading to 4.4.0? Assuming that’s after upgrading, is there any reason your external PowerShell 7 is still using 7.2.19? If not, have you tried upgrading it to 7.4.5 to see if there’s maybe some sort of incompatibility with 7.2.19 and something that changed along the way to PSU 4.4.0?

I mentioned that above.Yes, I’ve tried upgrading, it made no difference. The environments.ps1 above is pasted from my currently running environment using 4.2.13. I’m not really clear on what the “Version” argument to New-PSUEnvironment really does, but after upgrading to PS 7.4.5 I tried changing it to reflect the new version, that made no difference either.

Ah. Sorry. I must have missed that part.

Looking at your output again, I just noticed that the Variables sections look to be incorrect on Integrated and PowerShell 7.

They should normally look like -Variables @('*') but those 2 are empty. I’m not sure if that has anything to do with the issue, but something I noticed. Without those defined, those environment won’t be able to access any of the variables within PSU.

For reference, my environments.ps1 file looks like:

New-PSUEnvironment -Name "Windows PowerShell 5.1" -Version "5.1.20348.2652" -Path "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -Variables @('*') -RunspaceRecycling -Description "PowerShell environment for version 5.1.20348.2227. This was automatically detected on the server." 
New-PSUEnvironment -Name "Integrated" -Version "7.3.7" -Path "Universal.Server" -Variables @('*') -RunspaceRecycling -Description "An environment for running scripts directly in the PowerShell Universal server."
New-PSUEnvironment -Name "Agent" -Version "7.3.7" -Path "Universal.Agent" -Variables @('*') -RunspaceRecycling -Description "An environment for running scripts in an external PowerShell Universal agent process."
New-PSUEnvironment -Name "PowerShell 7" -Version "Unknown" -Path "C:\Program Files\PowerShell\7\pwsh.exe" -Variables @('*') -RunspaceRecycling -Description "The current version of PowerShell 7."

Can you send a system log to the support system? Typically, a 500 will display something. I would recommend increasing the log to debug to capture as much info as we can.

Oh, sorry. That must have been the forum software doing strange things to my quite, there is an asterisk there in the ps1 file :slight_smile:

1 Like

Yes, that was my thinking as well. I’ll look into it (need to do another upgrade to test) and report back!

edit: Ticket posted! https://github.com/ironmansoftware/powershell-universal/issues/3733