$AppList = Get-InstalledApplication -Name 'Air Explorer'
ForEach ($App in $AppList)
{
If($App.UninstallString)
{
$UninstPath = $($App.UninstallString).Replace('"','')
If(Test-Path -Path $UninstPath)
{
Write-Log -Message "Found $($App.DisplayName) $($App.DisplayVersion) and a valid uninstall string, now attempting to uninstall."
Execute-Process -Path $UninstPath -Parameters '/S'
Start-Sleep -Seconds 5
}
}
}
No comments:
Post a Comment