Last active
September 4, 2024 19:41
-
-
Save stephent23/b339c90b88a3cfd300a8 to your computer and use it in GitHub Desktop.
This retrieves the hash of the executing powershell script.
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
# 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