Download SysInternals with PowerShell

sysinternals Like many IT Pros, I’m a big fan of the utilities that make up the Sysinternals suite. A number of years ago, Microsoft created a “live” web directory (http:\\live.sysinternals.com\tools) that allowed you direct access to each utility. While this is very handy, personally I prefer to keep a local version. I used to periodically check the site and update my local folder, but now I can use PowerShell.

My version requires PowerShell 3.0. You need to have the WebClient service running in order to list the Internet files. My script has code to start and stop the service as needed. Although if it detects the service is already running, the script won’t stop it under the assumption that you probably had it running for a reason.

The logic behind the script is pretty simple, if the date of the online version is greater than the local version, copy the file. One thing I ran into though is that there can be a discrepancy with the time stamps due to time zones and/or daylight savings time. I couldn’t find an easy way to take those things into account so I opted to simply test the date and ignore the time.

The next thing I should do is set up a PowerShell scheduled job to run the script on a monthly basis. I hope you’ll let me know how this works out for you.

16 thoughts on “Download SysInternals with PowerShell”

    1. Yes on all counts. I never think about running the tools on a server so I didn’t think about that. And the script does in fact test for the existence of the folder. Of course, you could easily modify the script to create it for you should you so wish.

  1. for a long time I’ve just been using “robocopy /xo /s /z \\live.sysinternals.com/tools $dest” but I’ve found that many times robocopy can’t find that UNC path…

    1. Robocopy also needs the Webclient service running. If it fails or stops that would explain your problem.

    1. Certainly there are a number of ways to download items from the Internet. I’m not sure in this particular scenario if one technique is better than any others.

  2. Could you have the script update the OS environment variables path so when typing the system will automatically find the tools instead of remembering to type the full path?

    1. I don’t have anything specifically for that. If you want a permanent change, you could use PowerShell to modify the path settings in the registry. If you need help with that, I recommend the forums at PowerShell.org. A much better place to work on a problem than via blog comments.

Comments are closed.