$appName="Microsoft .Net"
$apps = Get-WmiObject -Class Win32_product | Where-Object { $_.Name -match $appName }
if(!$apps)
{
write-host "No applicaton found for: $appName" -ForegroundColor red
return ;
}
$i = 1
$n = $apps.length ;
foreach ($a in $apps)
{
echo $a.Name "($i / $n ) "
$a.Uninstall()
echo "Finish uninstall "
$i++
}
Powershell - 卸载程序
最新推荐文章于 2023-12-25 00:02:22 发布