diff --git a/src/lib/Request-FileDownload.psm1 b/src/lib/Request-FileDownload.psm1 index 8e1c533d..1e210e3d 100644 --- a/src/lib/Request-FileDownload.psm1 +++ b/src/lib/Request-FileDownload.psm1 @@ -21,11 +21,14 @@ function Request-FileDownload { Write-Verbose "[?] I'm at: $PWD" Write-Verbose "[?] Downloading at: $OutputFolder + $ExtendFolder" - $OutputFolder = Join-Path -Path $OutputFolder -ChildPath $ExtendFolder + + If ($ExtendFolder) { + $OutputFolder = Join-Path -Path $OutputFolder -ChildPath $ExtendFolder + } If (!(Test-Path $OutputFolder)) { Write-Status -Types "@" -Status "$OutputFolder doesn't exist, creating folder..." - New-Item -Path $OutputFolder + New-Item -Path $OutputFolder -ItemType Directory } $FileLocation = $(Join-Path -Path $OutputFolder -ChildPath "$OutputFile") diff --git a/src/scripts/Use-DebloatSoftware.ps1 b/src/scripts/Use-DebloatSoftware.ps1 index 248f1358..b21c141b 100644 --- a/src/scripts/Use-DebloatSoftware.ps1 +++ b/src/scripts/Use-DebloatSoftware.ps1 @@ -13,7 +13,7 @@ function Use-DebloatSoftware() { If (!$Revert) { $AdwCleanerDl = "https://downloads.malwarebytes.com/file/adwcleaner" - $AdwCleanerOutput = Request-FileDownload -FileURI $AdwCleanerDl -OutputFile "adwcleaner.exe" + [String] $AdwCleanerOutput = Request-FileDownload -FileURI $AdwCleanerDl -OutputFile "adwcleaner.exe" Write-Status -Types "+" -Status "Running MalwareBytes AdwCleaner scanner..." Start-Process -FilePath $AdwCleanerOutput -ArgumentList "/eula", "/clean", "/noreboot" -Wait Remove-ItemVerified $AdwCleanerOutput -Force @@ -21,7 +21,7 @@ function Use-DebloatSoftware() { Copy-Item -Path "$PSScriptRoot\..\configs\shutup10" -Destination "$(Get-TempScriptFolder)\downloads" -Recurse -Force $ShutUpDl = "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" - $ShutUpOutput = Request-FileDownload -FileURI $ShutUpDl -ExtendFolder "shutup10" -OutputFile "OOSU10.exe" + [String] $ShutUpOutput = Request-FileDownload -FileURI $ShutUpDl -ExtendFolder "shutup10" -OutputFile "OOSU10.exe" Push-Location -Path (Split-Path -Path $ShutUpOutput) If ($Revert) { @@ -32,7 +32,7 @@ function Use-DebloatSoftware() { Start-Process -FilePath $ShutUpOutput -ArgumentList "ooshutup10.cfg", "/quiet" -Wait # Wait until the process closes # } - Remove-ItemVerified "$ShutUpOutput" -Force # Leave no extra files + Remove-ItemVerified $ShutUpOutput -Force # Leave no extra files Pop-Location }