Created
October 8, 2016 21:29
-
-
Save sdwheeler/53dbbb096d808ed8742a52262506bea3 to your computer and use it in GitHub Desktop.
Download the latest version of the sysinternals tools
This file contains hidden or 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
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