Created
March 25, 2014 18:31
-
-
Save VertigoRay/9768169 to your computer and use it in GitHub Desktop.
Test pre-commit hook
This file contains 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
#!/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