Powershell : How to unstall Windows applications (for example XBox Live, Sticky Notes, Microsoft Teams, ...) using powershell scripts and silently

26 views Asked by At

I have tried different scripts to uninstall some applications. But Nothing works as espected.

For example :

$programName = "Sticky Notes"
$uninstallQuery = Get-WmiObject -Query "SELECT * FROM Win32_Product WHERE Name LIKE '%$programName%'"

if ($uninstallQuery -ne $null) {
    $uninstallQuery.Uninstall()
    Write-Host "$programName uninstalled successfully."
} else {
    Write-Host "$programName not found on the system."
}

returns nothing

Sticky Notes not found on the system.

And the application exist.

Snap shot of applications list

Do you have some working scripts in powershell to uninstall applications in windows 11 ?

BR

Jeronimo

0

There are 0 answers