Skip to content

Instantly share code, notes, and snippets.

@sdwheeler
Created October 8, 2016 21:29
Show Gist options
  • Save sdwheeler/53dbbb096d808ed8742a52262506bea3 to your computer and use it in GitHub Desktop.
Save sdwheeler/53dbbb096d808ed8742a52262506bea3 to your computer and use it in GitHub Desktop.
Download the latest version of the sysinternals tools
function update-sysinternals {
param([switch]$exclusions=$false)
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = [Security.Principal.WindowsPrincipal] $identity
if($principal.IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
$web = get-service webclient
if ($web.status -ne "Running") { "Starting webclient..."; start-service webclient }
$web = get-service webclient
while ($web.status -ne "Running") { sleep -sec 1 }
if ($exclusions) {
robocopy \\live.sysinternals.com\tools "C:\Public\Sysinternals" /s /e /XF thumbs.db /xf strings.exe /xf sysmon.exe /xf psexec.exe
} else {
robocopy \\live.sysinternals.com\tools "C:\Public\Sysinternals" /s /e /XF thumbs.db
}
} else {
"Updating Sysinternals tools requires elevation."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment