Check that checksum: Validate media files with PowerShell

When copying files from the Internet, especially ISO files, it is a best practice to validate the checksum to guarantee that the data was not changed in transit or even at the source. If the match provided by the vendor is the same that you have on your computer, then you are in an excellent place to start deploying software. Let us do a simple example. I will be using my MSDN website to download the Windows Server 2016. We are going to check the checksum of such file and the algorithm being used (sha1) -- and this is a way that you can validate media files.

I’ve created a simple PowerShell script to validate media files downloaded from the Internet. The script requires two parameters, which are filename and checksum, and by default, the script uses the SHA1 algorithm. We can change the algorithm using the -algorithm switch.

Here is an example of Windows Server 2016 where the checksum matches.

Here is an example of the same file when the checksum does not match.

You can download the script I used to validate media files from my GitHub account here.

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides of the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange, CISSP and several other certifications. Anderson contributes to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at,, and Anderson (Portuguese).

Published by
Anderson Patricio

Recent Posts

User-friendly web design tools for a user-friendly website

If you want your business to succeed these days, you need a user-friendly website. Put these tools in your toolbox…

10 hours ago

New kids vs. old reliable: Can chat apps replace email?

Do businesses rely too heavily on email for communication? Yes! Is the answer to replace email with chat apps? No!…

15 hours ago

PowerShell function to standardize message box script outputs

If you got your start with Visual Basic, you remember msgbox. This PowerShell function will bring back memories and help…

18 hours ago

Microsoft Ignite 2019: Top announcements and product unveilings

Microsoft Ignite 2019 included a slew of updates on products and services. Among the announcements was Azure Arc, which may…

1 day ago

Who says configuration management can’t be fun?

Managing change in an enterprise isn’t easy and it’s usually no fun. Here’s a book on configuration management that will…

2 days ago

Choosing the right communication tools for your business

Choosing communication tools is like choosing a first progamming language. While you want easy, you also want cross-platform, security, and…

2 days ago