Powershell script for uninstall

Job ID: 37182404

Budget: $10 – $30 USD

Looking for a powershell script that can start a process (msiexec.exe) with parameters. We have a working script, but if a problem occurs, and the msiexec.exe does not terminate, the script remains hung. Looking to be able to have a way of checking the status, and if timesout or completes, return the status.

$UnInstallPwd = '"'##*8dfasjf@#$-ijuOO'
$product = Get-WmiObject win32_product | Where-Object{$_.name -eq "Something"}
$ProductID = $product.IdentifyingNumber
LogMessage "Found Something, attempting MSI Uninstall"
$Arguments = "/qn /x $ProductID UNINSTALLKEY=$UninstallPwd"
LogMessage "Running Uninstall script with arguments $Arguments"

Start-Process -filePath "C:\Windows\System32\msiexec.exe" -ArgumentList $Arguments -Wait
Related categories: Windows Desktop Powershell