Forum Discussion

NoahScott's avatar
NoahScott
Brass Contributor
Feb 23, 2024

Issues with a query for windows app

I've been asked to clean up some bloatware recently on our machines... so i'm getting to testing some scripting - I have some test machines to perform these tasks on. 

I've done the following 

- Created a collection with a query with the following information. Setting this to a limiting collection of my test machines, i see a handful of computers that are confirmed to have the app.

 

- This is my script i have sending to those machines - i did test it on a single machine and did remove both the APPX and the Provisioned package... i'm now onto testing the deployment via SCCM.

 

 ###########################################
#### Remove both appx and provisioned appx
###########################################

# Specify the app name
$appName = 'Bingsports'

# Remove provisioned packages based on the specified name
Get-AppxProvisionedPackage -Online | 
    Where-Object { $_.DisplayName -like "*$appName*" } | 
    ForEach-Object { 
        Remove-AppxProvisionedPackage -Online -PackageName $_.PackageName 
    }

# Remove installed packages based on the specified name
Get-AppxPackage -AllUsers "*$appName*" | 
    Remove-AppxPackage -AllUsers 

 

 

- the deployment is set with the following switches. 

powershell.exe -ExecutionPolicy Bypass -File APPXDebloat\Sports.ps1

 

On one of the test machines before the script ran, this script showed BOTH were installed, after the script ran, it's showing neither are installed.. 

Just to verify, i ran the following search for anything BING and nothing is showing up for either installed or provisioned for bingsports.  

 

However, the machines i'm doing this on is all the same story, but the query is still showing the application there - as the app is gone, i feel like the script seems to be perfectly functional, but i'm not sure specifically where the QUERY is looking for the windows app? 

 

Any help would be greatly appreciated! 

Resources