Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.