PowerShell – WinSCP uninstall

#madeBy krolaki.eu
#-------------[deklarations]--------------------------
#params
$winscpActualVersion='6.1.2'
$winscp
#-------------[functions]--------------------------
function getWinScp {
    return $winscp = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match 'WinSCP' }
}

$winscp = getWinScp
if($winscp.Version -eq $winscpActualVersion) {
    break
} else {
    $winscp.Uninstall()
}

Leave a Reply

Your email address will not be published. Required fields are marked *