PowerShell: Running script from WSL with noninteractive flag will show "SecurityError: AuthorizationManager check failed."
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
/mnt/c/Program\ Files/PowerShell/7/pwsh.exe -noninteractive -executionpolicy unrestricted -file ./xxx.ps1
Expected behavior
runs successfully since there is a -executionpolicy unrestricted
flag
Actual behavior
SecurityError: AuthorizationManager check failed.
Error details
I don’t know how to provide this since I’m starting a .ps1
file and the session ends before the file’s execution
Environment data
Name Value
---- -----
PSVersion 7.2.5
PSEdition Core
GitCommitId 7.2.5
OS Microsoft Windows 10.0.22000
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 16 (3 by maintainers)
@leoleoasd the \\WSL$ is still working, so if you force the path, PowerShell should be OK with that.