I'm trying to ensure that a specific file is signed properly before
allowing the file to be commited.  I'm using powershell to do this,
but this isn't a powershell issue.  Here's the command I'm using to do
the check:

    /c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command
"If ((Get-AuthenticodeSignature .\test.ps1).Status -ne 'Valid') { Exit
1 }"

Note: I've tried with variation of the following powershell switches:

    -NoLogo -NonInteractive -NoProfile

At first, the appeared to be that the exit code is lost and is always
0.  After further investigation, it appears that this command doesn't
even run.  For example, here's a test command:

    /c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command
"Get-Location | Out-File C:\Temp\test.txt"

This *test* command runs fine when executed from the GitBash shell;
the test.txt file is created.  When in the pre-commit hook file, it
fails to create the test.txt file; this is technically TortoiseGit
running this part.

**Question:**  On windows, how do I ensure that a specific file is
signed properly before allowing the file to be commited?  Is there a
way to have the `gpg` command use the windows cert store for
validation of a signature?

I feel like this is a TortoiseGit issue, but wanted to bounce this on
you all.  I've submitted an issue:
https://code.google.com/p/tortoisegit/issues/detail?id=2143

--
~Ray
` ` ` ` ` ` ` ` ' ` ` ` ` ` ' ` ` ` ` ` ` `
Raymond A. S. Piller
http://Vertigion.com
682-651-5653
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to