diff --git a/Mysterious-MessyCode.ps1 b/Mysterious-MessyCode.ps1 index 9372ef8..fd26418 100644 --- a/Mysterious-MessyCode.ps1 +++ b/Mysterious-MessyCode.ps1 @@ -1 +1,4 @@ - $Uninstallers = Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*;($Uninstallers|% {$a=$_;Get-ItemProperty -name UninstallString -Path "$($a.name.replace('HKEY_LOCAL_MACHINE','HKLM:'))" -ErrorAction SilentlyContinue|? {(Get-ItemProperty -name DisplayName -Path $a.name.replace('HKEY_LOCAL_MACHINE','HKLM:')).DisplayName -like '*Carbon*'}}).UninstallString + $Appname = Read-Host "Search for Installed App" + $Uninstallers = Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*,HKLM:\Software\WoW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*; + ($Uninstallers|% {$a=$_; +Get-ItemProperty -name UninstallString -Path "$($a.name.replace('HKEY_LOCAL_MACHINE','HKLM:'))" -ErrorAction SilentlyContinue|? {(Get-ItemProperty -name DisplayName -ErrorAction SilentlyContinue -Path $a.name.replace('HKEY_LOCAL_MACHINE','HKLM:')).DisplayName -like "*$Appname*"}}).UninstallString -replace '"',"" |Invoke-Item