Skip to content

Commit d066db4

Browse files
authored
Update Invoke-DebloatSoftware.ps1 (#141)
Some minor optimization on cleaning after tool download & execution.
1 parent 091a6bd commit d066db4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/scripts/Invoke-DebloatSoftware.ps1

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ function Invoke-DebloatSoftware() {
1313

1414
If (!$Revert) {
1515
$AdwCleanerDl = "https://downloads.malwarebytes.com/file/adwcleaner"
16-
[String] $AdwCleanerOutput = (Request-FileDownload -FileURI $AdwCleanerDl -OutputFile "adwcleaner.exe")
16+
[String] $AdwCleanerOutput = (Request-FileDownload -FileURI $AdwCleanerDl -ExtendFolder "adwcleaner" -OutputFile "adwcleaner.exe")
1717
Write-Status -Types "+" -Status "Running MalwareBytes AdwCleaner scanner..."
1818
Start-Process -FilePath "$AdwCleanerOutput" -ArgumentList "/eula", "/clean", "/noreboot" -Wait
19-
Remove-ItemVerified $AdwCleanerOutput -Force
19+
Remove-ItemVerified (Split-Path -Path $AdwCleanerOutput) -Force -Recurse
2020
}
2121

2222
Copy-Item -Path "$PSScriptRoot\..\configs\shutup10" -Destination "$(Get-TempScriptFolder)\downloads" -Recurse -Force
@@ -26,14 +26,14 @@ function Invoke-DebloatSoftware() {
2626

2727
If ($Revert) {
2828
Write-Status -Types "*" -Status "Running ShutUp10 and REVERTING to default settings..."
29-
Start-Process -FilePath $ShutUpOutput -ArgumentList "ooshutup10-default.cfg", "/quiet" -Wait # Wait until the process closes #
29+
Start-Process -FilePath "$ShutUpOutput" -ArgumentList "ooshutup10-default.cfg", "/quiet" -Wait # Wait until the process closes #
3030
} Else {
3131
Write-Status -Types "+" -Status "Running ShutUp10 and applying Recommended settings..."
32-
Start-Process -FilePath $ShutUpOutput -ArgumentList "ooshutup10.cfg", "/quiet" -Wait # Wait until the process closes #
32+
Start-Process -FilePath "$ShutUpOutput" -ArgumentList "ooshutup10.cfg", "/quiet" -Wait # Wait until the process closes #
3333
}
34-
35-
Remove-ItemVerified $ShutUpOutput -Force # Leave no extra files
34+
3635
Pop-Location
36+
Remove-ItemVerified (Split-Path -Path $ShutUpOutput) -Force -Recurse # Leave no extra files
3737
}
3838

3939
If (!$Revert) {

0 commit comments

Comments
 (0)