To obtain the list of the program/Package installed use this command:
Get-WmiObject -Class Win32_Product
To remove the program/package installed use this command:
$packages = @("package1", "package2", "package3")
foreach($package in $packages) {
$app = Get-WmiObject -Class Win32_Product | Where-Object {
$_.Name -match "$package"
}
$app.Uninstall()
}
foreach($package in $packages) {
$app = Get-WmiObject -Class Win32_Product | Where-Object {
$_.Name -match "$package"
}
$app.Uninstall()
}
where package1, package2 and package3 are the programs to unistall.