Does anyone have a worklet to install Winget (Windows Package Manager)
I have used this post from JumpCloud in the past to get it installed. Copy and paste the code into a Worklet and run the Worklet: https://community.jumpcloud.com/t5/community-scripts/install-winget-in-the-system-context-and-applications-via-winget/m-p/1399
Link is dead. I have been experimenting with using add-appxpackage to install winget and using winget on existing windows 11 computer and not had any success on either.
I moved forward and attempted to use to use a windows 11 computer with winget installed. But all attempts to use winget have failed with winget not recognized. I tried to force the path %userprofile%\AppData\Local\Microsoft\WindowsApps but that was also not successful. I have another deploy product that is able to use winget in powershell to install. Am I missing something?
if (.\winget list --id Microsoft.PowerBI  | findstr Available) {
        # this will check installed version vs most recent available and if need upgrade if not will not
        Write-Host "Upgrading Power BI"
        .\winget upgrade --id=Microsoft.PowerBI 
}
 
Evaluation policy
if (.\winget list --id Microsoft.PowerBI  | findstr Available) {
Write-Host "Power BI out of date"
exit 1
}
else
{
exit 0
}
 
{"args":"","response":"[\"0\",null,\".\\\\winget : The term '.\\\\winget' is not recognized as the name of a cmdlet, function, script file, or operable program. \\r\\nCheck the spelling of the name, or if a path was included, verify that the path is correct and try again.\\r\\nAt C:\\\\Program Files (x86)\\\\Automox\\\\execDir3634317923\\\\execcmd4137578730.ps1:73 char:5\\r\\n+ if (.\\\\winget list --id Microsoft.PowerBI | findstr Available) {\\r\\n+ ~~~~~~~~\\r\\n + CategoryInfo : ObjectNotFound: (.\\\\winget:String) [], CommandNotFoundException\\r\\n + FullyQualifiedErrorId : CommandNotFoundException\"]"} Show Less
I have been unable to install winget with automox. I tried add-appxpackage -registerbyfamilyname and with local msixbundle file.
However the more important question is how to use winget from automox. On a windows 11 computer with working winget, every attempt to use winget to install software is failing. Automox cannot find working winget. I tried to specific path to winget with %userprofile%\AppData\Local\Microsoft\WindowsApps, this did not help. Any suggestions?
{"args":"","response":"[\"0\",null,\".\\\\winget : The term '.\\\\winget' is not recognized as the name of a cmdlet, function, script file, or operable program. \\r\\nCheck the spelling of the name, or if a path was included, verify that the path is correct and try again.\\r\\nAt C:\\\\Program Files (x86)\\\\Automox\\\\execDir3634317923\\\\execcmd4137578730.ps1:73 char:5\\r\\n+ if (.\\\\winget list --id Microsoft.PowerBI | findstr Available) {\\r\\n+ ~~~~~~~~\\r\\n + CategoryInfo : ObjectNotFound: (.\\\\winget:String) [], CommandNotFoundException\\r\\n + FullyQualifiedErrorId : CommandNotFoundException\"]"} Show Less
Login to the community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
