From 49e7a7d6969584460ac4a07febb76f424df0517d Mon Sep 17 00:00:00 2001 From: shayagoldbergitc <93670479+shayagoldbergitc@users.noreply.github.com> Date: Wed, 3 Nov 2021 13:10:05 -0400 Subject: [PATCH] Update Mysterious-MessyCode.ps1 --- Mysterious-MessyCode.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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