Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Removes Registry keys that PreForm leaves behind
# Check both Uninstall keys just to be sure
$RegistryPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
)
ForEach ( $RegistryPath in $RegistryPaths ) {
$RegistryKeys = Get-ChildItem "$RegistryPath" | Where-Object Name -match "PreForm"
# Check to see if there are any matches
if ( $RegistryKeys ) {
"Deleting the following registry keys:"
$RegistryKeys.Name
# Delete the found matches
$RegistryKeys | Remove-Item
} else {
"No matching registry keys found in: $RegistryPath"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.