Skip to content

Instantly share code, notes, and snippets.

@bacongobbler
Last active February 14, 2019 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bacongobbler/329c98dec7f8ff4e119341a33b29532b to your computer and use it in GitHub Desktop.
Save bacongobbler/329c98dec7f8ff4e119341a33b29532b to your computer and use it in GitHub Desktop.
$versions = @("v2.0.1", "v2.0.2", "v2.1.0", "v2.1.1", "v2.1.2", "v2.1.3", "v2.2.0", "v2.2.1", "v2.2.2", "v2.2.3", "v2.3.0", "v2.3.1", "v2.4.0", "v2.4.1", "v2.4.2", "v2.5.0", "v2.5.1", "v2.6.0", "v2.6.1", "v2.6.2", "v2.8.0", "v2.8.1", "v2.8.2-rc1", "v2.8.2", "v2.9.0-rc1", "v2.9.0-rc2", "v2.9.0-rc3", "v2.9.0-rc4", "v2.9.0-rc5", "v2.9.0", "v2.9.1", "v2.10.0-rc.1", "v2.10.0-rc.2", "v2.10.0-rc.3", "v2.10.0", "v2.11.0-rc.1", "v2.11.0-rc.2", "v2.11.0-rc.3", "v2.11.0-rc.4", "v2.11.0", "v2.12.0-rc.1", "v2.12.0-rc.2", "v2.12.0", "v2.12.1", "v2.12.2", "v2.12.3", "v2.13.0-rc.1")
if ($env:TEMP -eq $null) {
$env:TEMP = Join-Path $env:SystemDrive 'tmp'
}
Update-MpSignature
foreach ($version in $versions) {
$url = "https://storage.googleapis.com/kubernetes-helm/helm-$version-windows-amd64.zip"
$tempDir = Join-Path $env:TEMP "helm-$version"
if (![System.IO.Directory]::Exists($tempDir)) {[void][System.IO.Directory]::CreateDirectory($tempDir)}
$file = Join-Path $env:TEMP "helm-$version-windows-amd64.zip"
Write-Output "Downloading helm $version from $url"
(new-object System.Net.WebClient).DownloadFile($url, $file)
Expand-Archive -Path "$file" -DestinationPath "$tempDir" -Force
Write-Output "helm $version extracted to $tempDir"
Write-Output "scanning helm $version. Please wait..."
$job = Start-MpScan -AsJob -ScanPath "$tempDir"
Wait-Job $job
Receive-Job -Job $job
Write-Output "done scanning helm $version"
}
@jdolitsky
Copy link

May want to also run Update-MpSignature to get latest malware definitions
https://docs.microsoft.com/en-us/powershell/module/defender/update-mpsignature?view=win10-ps

@bacongobbler
Copy link
Author

Good catch. Added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment