Update SysInternals Suite via PowerShell

SysInternals Suite is a collection of troubleshooting tools for Windows, developed by Microsoft. You can download the tools as a ZIP-file, that you can extract into a directory, and run the individual applications without having to install them.

When I find out there’s a new version of the SysInternals Suite, I have to click the link to the website, click the download link, save the ZIP-file, open the ZIP-file and select the destination folder to extract to. After having done this for the umpteenth time, I wrote the following PowerShell-script to automate the process:

$url = 'https://download.sysinternals.com/files/SysinternalsSuite.zip'
$zipPath = 'd:\dev\tools\SysinternalsSuite.zip'
$tempFolder = 'd:\dev\tools\temp-sys-internals'
$folder = 'd:\dev\tools\sys-internals'

Write-Host 'Downloading' $url 'to' $zipPath
$web = New-Object System.Net.WebClient
$web.DownloadFile($url, $zipPath)

Write-Host 'Extracting' $zipPath 'to' $tempFolder
Add-Type -assembly 'System.IO.Compression.FileSystem'
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipPath, $tempFolder)

Write-Host 'Copying files from' $tempFolder 'to' $folder
Copy-Item (Join-Path $tempFolder '*') $folder

Write-Host 'Removing temporary files'
Remove-Item $zipPath
Remove-Item $tempFolder -Recurse

The above script installs the SysInternals Suite in the directory d:\dev\tools\sys-internals. Please change the variables for your specific installation, before running the script.