Skip to content

Commit

Permalink
Update Invoke-DebloatSoftware.ps1 (#141)
Browse files Browse the repository at this point in the history
Some minor optimization on cleaning after tool download & execution.
  • Loading branch information
747DB66FBC authored Nov 24, 2023
1 parent 091a6bd commit d066db4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/scripts/Invoke-DebloatSoftware.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit d066db4

Please sign in to comment.