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

Amazon SES unveils new Bring Your Own IP feature

You’ve heard of Bring Your Own Device, and now there’s Bring Your Own IP. Here’s a look at this useful…

12 hours ago

Why API security is becoming the next big challenge

The shift to REST APIs has an unintended consequence for DevOps: new attack vectors. A security expert walks us through…

17 hours ago

Can ‘silent meetings’ solve your IT planning woes?

Companies are adopting the concept of silent meetings as a way to make business meetings more productive. Does this work?

20 hours ago

CES 2020: Latest innovations in laptops and smartphones

CES 2020 was more than just wild gadgets and crazy gizmos. There were some serious unveilings of new smartphones and…

2 days ago

WordPress vulnerability puts 300,000 at risk for attack

A WordPress vulnerability that could affect 300,000 users has been identified and patched. By if admins don’t update, they remain…

2 days ago

PowerShell jobs — because you have better things to do than wait

If you run PowerShell commands that take a while to complete, consider using PowerShell jobs, which will allow the command…

2 days ago