The cmdlet you need to use to calculate the hash of a file is Get-FileHash.
Get-FileHash
Get-FileHash .\myfile.txt
Get-FileHash .\myfile.txt -Algorithm MD5