Skip to content

Instantly share code, notes, and snippets.

@VertigoRay
Created March 25, 2014 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VertigoRay/9768169 to your computer and use it in GitHub Desktop.
Save VertigoRay/9768169 to your computer and use it in GitHub Desktop.
Test pre-commit hook
#!/bin/sh
# Line to test if POSH is even executing
/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command "Get-Location | Out-File C:\Temp\test.txt"
if /c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command "If ((Get-AuthenticodeSignature .\install.ps1).Status -ne 'Valid') { Exit 1 }"
then
cat <<\EOF
The install.ps1 file has a valid signature.
EOF
# exit 0
else
cat <<\EOF
Error: The install.ps1 file does NOT have a valid signature.
https://git.cas.unt.edu/winstall/winstall/wikis/code-sign
EOF
# exit 1
fi
# Always faile while testing ...
exit 1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment