Brief description of your issue
WinGet can't be run on a WinRM session. The UWP magic doesn't seem to understand such a setup and so there are various problems:
- The
winget command can't be found, despite the WindowsApps directory being in $PATH;
- Access is denied ("The system cannot execute the specified program.") when providing a full path to the executable.
I'm working on a Chef cookbook which adds WinGet as a custom resource (so it can install packages) but at present this can't be smoothly tested because the call to the winget executable always fails.
Steps to reproduce
- Use
Enter-PSSession, vagrant powershell or the like to open a remote PowerShell session to a host with WinGet installed.
- Try to run WinGet.
Expected behavior
- WinGet prints its help output as it does when run in a local terminal
Actual behavior
Typical example output on an interactive session on a local Windows VM created by Vagrant:
[127.0.0.1]: PS C:\Users\vagrant\Documents> winget
Program 'winget.exe' failed to run: A specified logon session does not exist. It may already have been terminated.
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
[127.0.0.1]: PS C:\Users\vagrant\Documents> cd $Env:LOCALAPPDATA/Microsoft/WindowsApps
[127.0.0.1]: PS C:\Users\vagrant\AppData\Local\Microsoft\WindowsApps> ls
Directory: C:\Users\vagrant\AppData\Local\Microsoft\WindowsApps
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 20/05/2020 22:57 Backup
d----- 20/05/2020 22:57 Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
d----- 06/02/2020 20:09 Microsoft.MicrosoftEdge_8wekyb3d8bbwe
d----- 20/05/2020 18:10 Microsoft.XboxGamingOverlay_8wekyb3d8bbwe
-a---l 20/05/2020 18:10 0 GameBarElevatedFT_Alias.exe
-a---l 06/02/2020 20:09 0 MicrosoftEdge.exe
-a---l 20/05/2020 22:57 0 python.exe
-a---l 20/05/2020 22:57 0 python3.exe
-a---l 20/05/2020 22:57 0 winget.exe
[127.0.0.1]: PS C:\Users\vagrant\AppData\Local\Microsoft\WindowsApps> .\winget.exe
Program 'winget.exe' failed to run: A specified logon session does not exist. It may already have been terminated.
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
[127.0.0.1]: PS C:\Users\vagrant\AppData\Local\Microsoft\WindowsApps>
Environment
Windows Package Manager v0.1.41331 Preview
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.18363.836
Package: Microsoft.DesktopAppInstaller v1.0.41331.0
Links:
Privacy Statement: https://aka.ms/winget-privacy
License agreement: https://aka.ms/winget-license
3rd Party Notices: https://aka.ms/winget-3rdPartyNotice
Homepage: https://aka.ms/winget
Any other software?
Brief description of your issue
WinGet can't be run on a WinRM session. The UWP magic doesn't seem to understand such a setup and so there are various problems:
wingetcommand can't be found, despite the WindowsApps directory being in $PATH;I'm working on a Chef cookbook which adds WinGet as a custom resource (so it can install packages) but at present this can't be smoothly tested because the call to the
wingetexecutable always fails.Steps to reproduce
Enter-PSSession,vagrant powershellor the like to open a remote PowerShell session to a host with WinGet installed.Expected behavior
Actual behavior
Typical example output on an interactive session on a local Windows VM created by Vagrant:
Environment
Any other software?