10 lines
505 B
PowerShell
10 lines
505 B
PowerShell
# array of uninstall args
|
|
$uninstallArgs = "/uninstall"," ","/quiet", "/norestart"
|
|
$dotnetVersions = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -eq "FortiClient VPN*" }
|
|
|
|
foreach ($version in $dotnetVersions) {
|
|
# update array index 1 with version id
|
|
$uninstallArgs[1] = '"' + $version.IdentifyingNumber + '"'
|
|
Write-Host "Uninstalling $($version.Name) ($($version.Version))... $("$uninstallArgs")"
|
|
Start-Process -FilePath "msiexec.exe" -ArgumentList "$uninstallArgs" -Wait
|
|
} |