Using winget with pdq deploy?
So i am trying to install an app driectly from the microsoft store. I am able to do it on the machine using winget. I cannot do it through pdq is there a way to make this work?
James D solution is at the bottom wrap the winget in a ps1 file then run it that way.
Example
winget install "lenovo commercial vantage" --accept-package-agreements --accept-source-agreements
is what i put directly into the ps section of pdq deploy and it threw errors.
If i wrap that ps code into a ps1 file then execute that it worked flawlessly.
Thanks again James D
0
Comments
Can you share how you have your package setup and any errors you are getting when it fails through PDQ?
winget install "lenovo commercial vantage"
after that it i hit enter on the remote machine. i tried the same command and it just doesnt work.
My guess is it's related to the user PDQ runs the commands as. Either the install is prompting for agreements, so it's not silent and it's asking for interaction. Or the session doesn't have access to Winget. This is just an assumption, it would help to see the errors you're getting and screenshots of the package configuration.
See if you can integrate --accept-package-agreements and --accept-source-agreements into your script.
https://learn.microsoft.com/en-us/windows/package-manager/winget/install#:~:text=%2D%2Daccept%2Dpackage%2Dagreements,source%20license%20agreement%2C%20and%20avoid%20the%20prompt.
winget : The term 'winget' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Windows\AdminArsenal\PDQDeployRunner\service-1\exec\user.ps1:1 char:1
+ winget install "lenovo commercial vantage" --accept-package-agreement ...
this is the ps output
Side Note. If your not, run the PowerShell step calling a PS1 file instead of pasting the script into the PowerShell step itself. This has helped alleviate issues for me, don't understand why it works better though.
I don't think the PDQ user has access to the Winget app. I'd verifying the app is installed and run the install prior if it's not. Something like this.
$Winget = Get-AppxPackage -AllUsers "*DesktopAppInstaller*"
if($Null -eq $Winget)
{
$ProgressPreference='Silent'
Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v1.3.2691/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -OutFile .\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx
Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx
Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
}
James D this works. I just wrapped my script in a ps1 file and it worked... Kinda dumb but ive done worse work arounds....
Please sign in to leave a comment.