Repository navigation
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.WG-Cmdletsgeneral cmdlet issues
Description
Steps to reproduce
In WSL I created the following script file
echo "Write-Host Hello!" > test.ps1From WSL I attempted to run the script:
$ pwsh.exe -C ./test.ps1
./test.ps1: AuthorizationManager check failed.
$ pwsh.exe -F ./test.ps1
SecurityError: AuthorizationManager check failed.
Running the same script with Windows PowerShell succeeds:
$ powershell.exe -C ./test.ps1
Hello!
Expected behavior
I expected the script to run successfully, as it does with Windows PowerShell
Actual behavior
$ pwsh.exe -C ./test.ps1
./test.ps1: AuthorizationManager check failed.
$ pwsh.exe -F ./test.ps1
SecurityError: AuthorizationManager check failed.
Environment data
$PSVersionTable
powershell.exe:
Name Value
---- -----
PSVersion 5.1.19041.1
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
pwsh.exe:
Name Value
---- -----
PSVersion 7.0.2
PSEdition Core
GitCommitId 7.0.2
OS Microsoft Windows 10.0.19042
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Get-ExecutionPolicy -List
powershell.exe:
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine RemoteSigned
pwsh.exe
Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine RemoteSigned
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.WG-Cmdletsgeneral cmdlet issues
Activity
vexx32 commentedon Jul 5, 2020
Can you please grab the
Get-Erroroutput from the pwsh session that exhibited the error as well? Thanks!stuartleeks commentedon Jul 5, 2020
Here you go:
iSazonov commentedon Jul 6, 2020
I guess you run EXE not from WSL - from Windows but cwd is
\\wls$\path.Related #10674
stuartleeks commentedon Jul 7, 2020
Yes, I'm running
pwsh.exeto load PowerShell in Windows in this particular case, and the path is\\wsl$\Ubuntu-20.04\home\stuart