Hash File comparison is a good thing to do, to make sure that file in transit, transferred, downloaded, or copied over is not corrupted or has been altered or modified. PowerShell has a built-in module to do this that makes life easier and an easy task to do. Here's an example code snippet to do this: #Path location of the file $file="C:\Users\User1\Downloads\Win10_22H2_EnglishInternational_x64.iso" # Get the file hash $hashSrc = Get-FileHash $file -Algorithm "SHA256" write-output $hashSrc #copy the Hash file $Display_hash_only = $hashSrc | Select-Object -Property Hash | ft -HideTableHeaders Write-Output $Display_hash_only Output of the write-output $hashSrc command, will show the Algorithm used, the Hash of the file and path location of the file. Algorithm : SHA256 Hash: AC5522F9DB9F4F432A1AADE69FEF268C8C0B5FD3F22D3A6987719752F8A7108 Path : C:\Users\User1\Downloads\Win10_22H2_EnglishInternational_x64.iso After getting the Hash File run this code...
Make the world a better place by sharing knowledge, ideas and anything that you can give that comes from the heart.