PowerShell – remove old QGIS version

#madeBy krolaki.eu
#-------------[deklarations]--------------------------
#params
$qgisGoodVersion1='3.32.3'
$qgisGoodVersion2='3.22.16'
$qgis
#-------------[functions]--------------------------
function getQgis {
    return $qgis = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match 'QGIS' }
}

$qgis = getQgis
if($qgis.Version -eq $qgisGoodVersion1 -or $qgis.Version -eq $qgisGoodVersion2) {
    break
} else {
    $qgis.Version
}

Leave a Reply

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