Last active
February 15, 2022 22:13
-
-
Save wise-io/68effd9dbbe3fa45de9e9ac09367709d to your computer and use it in GitHub Desktop.
Downloads Malwarebytes Toolset
This file contains 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 characters
# https://support.malwarebytes.com/hc/en-us/articles/1500004655761-Download-and-update-the-Malwarebytes-Toolset | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string]$RegKey | |
) | |
$ArchivePath = "$env:SystemDrive\Utilities\MBTS.zip" | |
$Toolset = "$env:SystemDrive\Utilities\MBTS" | |
$DownloadURL = 'https://toolset.malwarebytes.com/file/mbts/' + $RegKey | |
try { | |
# Create Directory | |
if (!(Test-Path (Split-Path $ArchivePath))) { New-Item -ItemType Directory -Force -Path (Split-Path $ArchivePath) } | |
# Download Malwarebytes Toolset | |
Invoke-WebRequest -Uri $DownloadURL -OutFile $ArchivePath | |
# Extract Malwarebytes Toolset | |
Expand-Archive -Path $ArchivePath -DestinationPath $Toolset -Force | |
} | |
catch { throw $Error } | |
finally { | |
# Delete Archive | |
Remove-Item -Path $ArchivePath -Force -ErrorAction Ignore | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment