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

Winget.exe not located - empty $winget variable #20

Open
saqib-s opened this issue Nov 22, 2023 · 1 comment
Open

Winget.exe not located - empty $winget variable #20

saqib-s opened this issue Nov 22, 2023 · 1 comment

Comments

@saqib-s
Copy link

saqib-s commented Nov 22, 2023

(Thanks for sharing your hardwork!)

for the script: procative-remediation-creation.ps1

testing on a new Windows 11 23H2 machine, I found that the following code the $winget variable is returning empty.

$Winget = Get-ChildItem -Path (Join-Path -Path (Join-Path -Path $env:ProgramFiles -ChildPath "WindowsApps") -ChildPath "Microsoft.DesktopAppInstaller*_x64*\winget.exe")

I've replaced the variable with just the command and this seems to work.

so this:
if ($(&winget upgrade) -like "* $app_2upgrade *") {

instead of this
if ($(&$winget upgrade) -like "* $app_2upgrade *") {

no sure if this is something related to new winget release or and update?

@saqib-s
Copy link
Author

saqib-s commented Nov 22, 2023

My mistake - this is the behaviour under User but as SYSTEM the commands you are using are correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant