ironmansoftware / powershell-universal

Issue tracker for PowerShell Universal
https://powershelluniversal.com
35 stars 2 forks source link

Windows PowerShell scripts not starting #3728

Closed adamdriscoll closed 5 days ago

adamdriscoll commented 1 week ago

Version

5.0.6

Severity

Low

Environment

msi

Steps to Reproduce

We've had a couple reports of Windows PowerShell not working properly in v5. It's fine on my local machine and in our integration tests but there must be something wonky going on.

Expected behavior

WinPS works every where

Actual behavior

WinPS does not

Additional Environment data

No response

Screenshots/Animations

No response

mwatts-seg commented 1 week ago

Is this related to using alternate credentials with PS5?

adamdriscoll commented 1 week ago

The other users are just trying to run WinPS. No alternate creds but looking into that as well. Seems like it's gotta be related somehow since PS7 works.

rstolpe commented 1 week ago

The other users are just trying to run WinPS. No alternate creds but looking into that as well. Seems like it's gotta be related somehow since PS7 works.

Don't know if this is the same issue I have with PS7 but for PS7 it seems to only happen when it's external modules loading that you have downloaded from PSReposotory or any other 3rd party repo.

Jup, only one PS7 script that have issues in ps7 (works in 4.4.0) all of the others are running in ps5 environment. #3722 3722

JCrabtree911 commented 1 week ago

The most likely issue with PS5.1 is this bug related to $env:ModulePath The error messages that appear in a PS5.1 dashboard on UD5 match this bug exactly.

adamdriscoll commented 1 week ago

This fix will be in v5.0.7. I still can't reproduce this but I do see that the PSModulePath is incorrect in v5.

rstolpe commented 1 week ago

This fix will be in v5.0.7. I still can't reproduce this but I do see that the PSModulePath is incorrect in v5.

That could explain why many of my ps5 scripts that are depending on 3rd party modules failed.

JCrabtree911 commented 17 hours ago

5.07 did not resolve this for me. I intalled 5.07 and my PS5.1 Dashboards still don't startup. They fail with the same error message that points to the PSModulePath being wrong:

One or more errors occurred

The following error occurred while loading the extended type data file: Error in TypeData "System.Security.AccessControl.ObjectSecurity": The member AuditToString is already present. Error in TypeData "System.Security.AccessControl.ObjectSecurity": The member AccessToString is already present. Error in TypeData "System.Security.AccessControl.ObjectSecurity": The member Sddl is already present. Error in TypeData "System.Security.AccessControl.ObjectSecurity": The member Access is already present. Error in TypeData "System.Security.AccessControl.ObjectSecurity": The member Group is already present. Error in TypeData "System.Security.AccessControl.ObjectSecurity": The member Owner is already present. Error in TypeData "System.Security.AccessControl.ObjectSecurity": The member Path is already present.