Winget not Working in Bigfix

I am trying to get a winget task to run in Bigfix and it is not working. I did find that winget will not run as system. Now I am trying to run it as current user.

override wait
runas=currentuser

wait cmd.exe /c winget uninstall “windows web experience pack”

should be able to do this in powershell:

Get-AppxPackage "WebExperience" | Remove-AppxPackage

We use this PowerShell script to deloy via Winget:
https://github.com/djust270/Intune-Scripts/blob/master/Winget-InstallPackage.ps1

We prefetch the script, then use action script…

// Enter Winget Package ID below
parameter "PackageID" = "FOO.BAR"

//Install 
waithidden powershell.exe -ExecutionPolicy Bypass -file __download\SCRIPTNAME.PS1 -PackageID {parameter "PackageID"}


4 Likes

Wow! That is a very complex powershell script. It is interesting that the script can make winget run as system. I was thinking it would be very simple to remove Web Experience with Bigfix, but it is not turning out to be simple.

For a one liner, this powershell command seems to work when running as system, but I have not done much testing.

Get-AppxPackage -AllUsers | Where-Object {$_.Name -like 
"*WebExperience*"} | Remove-AppxPackage -AllUsers -ErrorAction 
SilentlyContinue

Hi Atlauren,

I found from the author of the Winget-InstallPackage.ps1 script, that it does not work for the “Windows Web Experience Pack”. He said to use remove-appxpackage.

But then, if you want to add “Windows Web Experience Pack” back after removing it, it will not run under system context.

1 Like