Powershell scripting to clean old windows python registry data

$path = get-childItem “HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\YOUR_UUID_NUMBERS\Components”

$data = “Python3116”
cd “HKLM:\”
Foreach($key in $path) {
    IF( ( $key.GetValueNames() | %{$key.GetValue($_)}) -match $Data){
        Write-Host $key
# Uncomment the line below to delete the old data
        #Remove-Item $key -Verbose
    }
}

Leave a Reply

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