top of page

PowerShell Script to compare the hash values of multiple files

You can use the below PowerShell script to compare the hash values of multiple pairs of files.


Begin by giving each path for each file in your data set a unique name.

$file1 = "C:\foofolder\set1\analysis.xlsx”

$file2 = "C:\foofolder\set2\analysis.xlsx"

$file3 = "C:\foofolder\set1\Memo.docx”

$file4 = "C:\foofolder\set2\Memo.docx"

$file5 = "C:\foofolder\set1\Show1.pptx”

$file6 = "C:\foofolder\set2\Show1v2.pptx"


. . . then prepare lines comparing the hash of the first file to the second file:


if((Get-FileHash $file1).hash -ne (Get-FileHash $file2).hash)


. . . . you can parse through your data on an Excel spreadsheet like this:




. . . using a formula to number the files side by side. Copy the lines to a text editor and remove the resulting tabs, putting each line of script on a new line as necessary.


The script will give you a list of which files are same and which are different in the same order in which they are listed in the script.





$file1 = "C:\foofolder\set1\analysis.xlsx”

$file2 = "C:\foofolder\set2\analysis.xlsx"

$file3 = "C:\foofolder\set1\Memo.docx”

$file4 = "C:\foofolder\set2\Memo.docx"

$file5 = "C:\foofolder\set1\Show1.pptx”

$file6 = "C:\foofolder\set2\Show1v2.pptx"

if((Get-FileHash $file1).hash -ne (Get-FileHash $file2).hash)

{“files are different”}

Else {“Files are the same”}

if((Get-FileHash $file3).hash -ne (Get-FileHash $file4).hash)

{“files are different”}

Else {“Files are the same”}

if((Get-FileHash $file5).hash -ne (Get-FileHash $file6).hash)

{“files are different”}

Else {“Files are the same”}



See the post by Dr. Scripto here.

4 Comments


WKDU TRBD
WKDU TRBD
Jan 06

代发外链 提权重点击找我;

谷歌蜘蛛池 谷歌蜘蛛池;

Fortune Tiger…

Fortune Tiger…

谷歌权重提升/ 谷歌权重提升;

谷歌seo 谷歌seo;

谷歌霸屏 谷歌霸屏

蜘蛛池 蜘蛛池

谷歌快排 谷歌快排

Google外链 Google外链

谷歌留痕 谷歌留痕

Gái Gọi…

Gái Gọi…

Dịch Vụ…

谷歌霸屏 谷歌霸屏

负面删除 负面删除

币圈推广 币圈推广

Google权重提升 Google权重提升

Google外链 Google外链

google留痕 google留痕

Like

BFVY IRTO
BFVY IRTO
Dec 28, 2024

代发外链 提权重点击找我;

游戏推广 游戏推广;

Fortune Tiger Fortune Tiger;

Fortune Tiger Slots Fortune…

谷歌马甲包/ 谷歌马甲包;

谷歌霸屏 谷歌霸屏;

מכונות ETPU מכונות ETPU;

;ماكينات اي تي بي…

آلات إي بي بي…

ETPU maşınları ETPU maşınları;

ETPUマシン ETPUマシン;

ETPU 기계 ETPU 기계;

Like

WKDU TRBD
WKDU TRBD
Dec 28, 2024

代发外链 提权重点击找我;

谷歌蜘蛛池 谷歌蜘蛛池;

Fortune Tiger Fortune Tiger;

Fortune Tiger Slots Fortune…

谷歌权重提升/ 谷歌权重提升;

谷歌seo 谷歌seo;

מכונות ETPU מכונות ETPU;

Машини ETPU Машини ETPU

ETPU-Maschinen ETPU-Maschinen

EPS-машины EPS-машины

ЭПП-машины ЭПП-машины� بي يو

ETPU maşınları ETPU maşınları

ETPUマシン ETPUマシン

ETPU 기계 ETPU 기계

Like

AVXJ KAZD
AVXJ KAZD
Dec 26, 2024

代发外链 提权重点击找我;

google留痕 google留痕;

Fortune Tiger Fortune Tiger;

Fortune Tiger Fortune Tiger;

Fortune Tiger Slots Fortune…

站群/ 站群;

万事达U卡办理 万事达U卡办理;

VISA银联U卡办理 VISA银联U卡办理;

U卡办理 U卡办理;

万事达U卡办理 万事达U卡办理;

VISA银联U卡办理 VISA银联U卡办理;

U卡办理 U卡办理;

온라인 슬롯 온라인 슬롯;

온라인카지노 온라인카지노;

바카라사이트 바카라사이트;

EPS Machine EPS Machine;

EPS Machine EPS Machine;

EPS Machine EPS Machine;

EPS Machine EPS Machine;

Like
bottom of page