Skip to content

Instantly share code, notes, and snippets.

@stephent23
Last active September 4, 2024 19:41
Show Gist options
  • Save stephent23/b339c90b88a3cfd300a8 to your computer and use it in GitHub Desktop.
Save stephent23/b339c90b88a3cfd300a8 to your computer and use it in GitHub Desktop.
This retrieves the hash of the executing powershell script.
# Get Hash of Current script
$script = $MyInvocation.ScriptName
$md5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$hash = [System.BitConverter]::ToString($md5.ComputeHash([System.IO.File]::ReadAllBytes($script)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment