HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

Get-FileHash — Calculate a hash for a file. Note: This command can only be used through PowerShell. More informatio

Submitted by: @import:tldr-pages··
0
Viewed 0 times
hashcommandnoteget-filehashclifileforcalculate
windows

Problem

How to use the Get-FileHash command: Calculate a hash for a file. Note: This command can only be used through PowerShell. More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-filehash>.

Solution

Get-FileHash — Calculate a hash for a file. Note: This command can only be used through PowerShell. More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-filehash>.

Calculate a hash for a specified file using the SHA256 algorithm:
Get-FileHash {{path\to\file}}


Calculate a hash for a specified file using a specified algorithm:
Get-FileHash {{path\to\file}} -Algorithm {{SHA1|SHA384|SHA256|SHA512|MD5}}

Code Snippets

Calculate a hash for a specified file using the SHA256 algorithm

Get-FileHash {{path\to\file}}

Calculate a hash for a specified file using a specified algorithm

Get-FileHash {{path\to\file}} -Algorithm {{SHA1|SHA384|SHA256|SHA512|MD5}}

Context

tldr-pages: windows/Get-FileHash

Revisions (0)

No revisions yet.