From d066db40afbb35dd2aaf2d6b120a9a4c52f7234c Mon Sep 17 00:00:00 2001 From: 747DB66FBC <133031823+747DB66FBC@users.noreply.github.com> Date: Fri, 24 Nov 2023 22:41:15 +0100 Subject: [PATCH] Update Invoke-DebloatSoftware.ps1 (#141) Some minor optimization on cleaning after tool download & execution. --- src/scripts/Invoke-DebloatSoftware.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/scripts/Invoke-DebloatSoftware.ps1 b/src/scripts/Invoke-DebloatSoftware.ps1 index b54440b6..186a190c 100644 --- a/src/scripts/Invoke-DebloatSoftware.ps1 +++ b/src/scripts/Invoke-DebloatSoftware.ps1 @@ -13,10 +13,10 @@ function Invoke-DebloatSoftware() { If (!$Revert) { $AdwCleanerDl = "https://downloads.malwarebytes.com/file/adwcleaner" - [String] $AdwCleanerOutput = (Request-FileDownload -FileURI $AdwCleanerDl -OutputFile "adwcleaner.exe") + [String] $AdwCleanerOutput = (Request-FileDownload -FileURI $AdwCleanerDl -ExtendFolder "adwcleaner" -OutputFile "adwcleaner.exe") Write-Status -Types "+" -Status "Running MalwareBytes AdwCleaner scanner..." Start-Process -FilePath "$AdwCleanerOutput" -ArgumentList "/eula", "/clean", "/noreboot" -Wait - Remove-ItemVerified $AdwCleanerOutput -Force + Remove-ItemVerified (Split-Path -Path $AdwCleanerOutput) -Force -Recurse } Copy-Item -Path "$PSScriptRoot\..\configs\shutup10" -Destination "$(Get-TempScriptFolder)\downloads" -Recurse -Force @@ -26,14 +26,14 @@ function Invoke-DebloatSoftware() { If ($Revert) { Write-Status -Types "*" -Status "Running ShutUp10 and REVERTING to default settings..." - Start-Process -FilePath $ShutUpOutput -ArgumentList "ooshutup10-default.cfg", "/quiet" -Wait # Wait until the process closes # + Start-Process -FilePath "$ShutUpOutput" -ArgumentList "ooshutup10-default.cfg", "/quiet" -Wait # Wait until the process closes # } Else { Write-Status -Types "+" -Status "Running ShutUp10 and applying Recommended settings..." - Start-Process -FilePath $ShutUpOutput -ArgumentList "ooshutup10.cfg", "/quiet" -Wait # Wait until the process closes # + Start-Process -FilePath "$ShutUpOutput" -ArgumentList "ooshutup10.cfg", "/quiet" -Wait # Wait until the process closes # } - - Remove-ItemVerified $ShutUpOutput -Force # Leave no extra files + Pop-Location + Remove-ItemVerified (Split-Path -Path $ShutUpOutput) -Force -Recurse # Leave no extra files } If (!$Revert) {