-
-
Save pdolinic/3c42c398245e0ba1da2907c7b76d1b7d to your computer and use it in GitHub Desktop.
Revisions
-
mgeeky revised this gist
Jun 27, 2023 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,10 @@ # PS> . .\Cleanup-ClickOnce.ps1 # PS> Cleanup-ClickOnce -Name MyAppName # # Other than that you might also try using these commands: # PS> rundll32 dfshim.dll,ShArpMaintain C:\Path\To\ClickOnce.application # PS> rundll32 dfshim.dll CleanOnlineAppCache # function Cleanup-ClickOnce($Name) { if ($Name.Length -gt 6) { -
mgeeky revised this gist
Jun 27, 2023 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,6 @@ # function Cleanup-ClickOnce($Name) { if ($Name.Length -gt 6) { $Name = $Name.Substring(0, 4) + "\." } @@ -18,8 +17,6 @@ function Cleanup-ClickOnce($Name) { If ($_ -match $rex) { Write-Host "[+] Cleaning: $($_.Name)" -ForegroundColor Green Remove-Item -Force -Recurse "Registry::$_" -EA SilentlyContinue | Out-Null } } -
mgeeky created this gist
Jun 27, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ # # Usage: # PS> . .\Cleanup-ClickOnce.ps1 # PS> Cleanup-ClickOnce -Name MyAppName # function Cleanup-ClickOnce($Name) { if ($Name.Length -gt 6) { $Name = $Name.Substring(0, 4) + "\." } $rex = $Name + "\..+" Write-Host "`nCleaning ClickOnce leftovers: $rex `n" -ForegroundColor Yellow Get-ChildItem -Recurse "HKCU:\Software\Classes\Software\Microsoft\Windows\CurrentVersion\Deployment\SideBySide\2.0" -EA SilentlyContinue | ForEach-Object { If ($_ -match $rex) { Write-Host "[+] Cleaning: $($_.Name)" -ForegroundColor Green Remove-Item -Force -Recurse "Registry::$_" -EA SilentlyContinue | Out-Null } } $Paths = @( "$env:Localappdata\Apps\2.0" "$env:Localappdata\Deployment" "$env:Localappdata\Microsoft\Windows\INetCache\IE" "$env:Temp\Deployment" ) foreach ($Path in $Paths) { Get-ChildItem -Recurse $Path | ForEach-Object { If ($_ -match $rex) { Write-Host "[+] Cleaning: $($_.FullName)" -ForegroundColor Green Remove-Item -Force -Recurse $_.FullName } } } }