Created
January 12, 2020 23:10
-
-
Save ml4den/d86468e7ece329f858b792b3dc0ac2c4 to your computer and use it in GitHub Desktop.
Hash a file easily with PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FileSelector { | |
# Define a function that allows the user to select files. | |
# Credit: https://4sysops.com/archives/how-to-create-an-open-file-folder-dialog-box-with-powershell/ | |
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ | |
InitialDirectory = [Environment]::GetFolderPath('Desktop') | |
} | |
$null = $FileBrowser.ShowDialog() | |
return $FileBrowser | |
} | |
$selectedFile = FileSelector | |
if (-Not ($selectedFile.FileName)) {break} | |
Get-FileHash -Path $selectedFile.FileName | fl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment