Skip to content

Instantly share code, notes, and snippets.

@Julienraptor01
Created April 20, 2024 21:19
Show Gist options
  • Select an option

  • Save Julienraptor01/111485388563739789ffd37b71681590 to your computer and use it in GitHub Desktop.

Select an option

Save Julienraptor01/111485388563739789ffd37b71681590 to your computer and use it in GitHub Desktop.
simple powershell script to get hashes in a similar format to 7z
(Get-Item (Read-Host "Enter the file name")) | % { "Name: $($_.Name)`nSize: $($_.Length) bytes ($([math]::Truncate($_.Length / 1MB)) MiB)`nSHA256: $((Get-FileHash -Path $_.FullName -Algorithm SHA256).Hash.ToLower())`nSHA1: $((Get-FileHash -Path $_.FullName -Algorithm SHA1).Hash.ToLower())" | Tee-Object -Variable output | Set-Clipboard; Write-Output $output }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment