-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Winget Powershell Cmdlets don't work from SYSTEM context #3409
Comments
The SYSTEM support was done by simply replacing the COM object creation, which works great for everything that is implemented via COM...
For now, the winget client module version can be used as a proxy for the winget code version. It won't match at all, but it is related in that there is a fixed version mapping AND both module version and winget code version will monotonically increase together (AKA |
Got it. Yeah I was having general issues with the other commands as well, but mixed in there was me forgetting that powershell pointed to 5 and pwsh pointed to 7. I chose version arbitrarily as my example, but let me test the others to see if they work as expected. So install and get are supposed to work as SYSTEM? |
I don't think anything in here will work: And then the version and user settings commands also won't work. |
I should have actually answered your question as well 😄
Yes, the mainline package management commands should be working. |
And yeah did some regression testing this morning with correct "pwsh.exe -mta" use and all is well with getpackage, install, upgrade from a small sample in a SYSTEM context. The comexception is handy for catch logic and maps back to the header error list so just need to check that in addition to the installererrorcode. Filtering on source and scope would be helpful, but that's all upstream of the cmdlets in issues like #1155. So just a bad initial test w version and making sure i was testing using the correct powershell config got me on the right track. |
Brief description of your issue
Trying to orchestrate Intune machine scoped installs (need to suppress UAC) using winget. Had some success with the winget commandline by adding the WindowsApp install location to PATH, but it's not ideal for scripting. Wanted to give the cmdlets a go now that they are published to gallery and are stabilizing a bit.
I know running the cmdlets from SYSTEM was probably not high on the list, but I know some of the Intune collaboration might benefit until they can create a new scope type that handles the elevated token grant for the logged in user (my use case is biased to Company Portal).
Steps to reproduce
get a shell running under SYSTEM. I used psexec -i -s cmd, but you could simulate using a Intune app or something.
Expected behavior
From my user prompt
If the cmdlets are going to cover SYSTEM a separate codepath to find the latest and add to PATH or set as working directory would be needed. Or I don't know if there is a method in MSIX to manually mount MSIXs to the context LOCALAPPDATA that would work for SYSTEM.
Actual behavior
Assumes the MSIX is mounted from ProgramData\WindowsApps to the %LOCALAPPDATA% mount point, but for SYSTEM that isn't the case.
Environment
The text was updated successfully, but these errors were encountered: