Skip to content
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

[Bug]: Running Get-WGPath delivers wrong path in System Context #14

Open
5 tasks done
AbsoluteBlack0 opened this issue Oct 4, 2022 · 5 comments
Open
5 tasks done
Assignees
Labels
bug Something isn't working

Comments

@AbsoluteBlack0
Copy link

AbsoluteBlack0 commented Oct 4, 2022

Describe the problem

I am running a system context Powershell session. Get-WingetPath delivers the wrong winget.exe location because it expects nt-authority. Culture is german, so the system answers with nt-autorität as result of whoami.

Log is in additional informations.

Expectation

No response

Additional Information

PS C:\Windows\system32> Get-WGPath
AUSFÜHRLICH: [14:10:07.3657127] Starting Get-WGPath
AUSFÜHRLICH: [14:10:07.3827148] Running as nt-autorität\system
AUSFÜHRLICH: [14:10:07.3837279] Using user default location
C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps\Winget.exe
AUSFÜHRLICH: [14:10:07.3867134] Ending Get-WGPath

PowerShell version

5.1

Platform

Windows 10 Pro or Enterprise

Additional Checks

  • You are using the latest version of this module.
  • You have read this repository's README file.
  • You have read full help and examples for the command you are having problems with.
  • You are running PowerShell in an elevated session.
  • You are running in a traditional PowerShell console or Windows Terminal
@AbsoluteBlack0 AbsoluteBlack0 added bug Something isn't working triage new issue that needs review labels Oct 4, 2022
@jdhitsolutions
Copy link
Owner

This is part of an ongoing issue dealing with non-English output. I'll add this to the list.

@jdhitsolutions jdhitsolutions removed the triage new issue that needs review label Oct 4, 2022
@jdhitsolutions
Copy link
Owner

What technique or process are you using to run as system?

@AbsoluteBlack0
Copy link
Author

AbsoluteBlack0 commented Oct 4, 2022

I am trying to write a proactive remediation script for intune which installs / uninstalls / updates a custom list of apps. At this point I am trying to run it in system context.

For testing purposes PSTools: PsExec.exe -s -i cmd.exe

I was trying to run plain winget in those scripts but as of now I could not find out why my winget list and winget upgrade calls did not deliver output.

It is more like a experimental learning process if I can use winget this way or if I need to stick to traditional Win32 deployment.

@jdhitsolutions
Copy link
Owner

That's the technique I use as well. The issue is the German culture and parsing that text.

@fredrikhenne
Copy link
Contributor

Sent a pull request with the changes that I'm using locally for swedish locale in which we match on SID instead of accountnames. #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants