{"thread":{"id":"36292","subject":"Windows Git pre-commit check file signature","startedAt":"2014-03-25T19:37:36Z","lastAt":"2014-03-25T19:37:36Z","messageCount":1,"participants":["Raymond Piller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"237766","messageId":"CAJymQJz=Tu5cAJYUw3fxOyMkn4v-m_91NhcZ9BjjHz2CX9xnyg@mail.gmail.com","threadId":"36292","inReplyTo":null,"subject":"Windows Git pre-commit check file signature","fromName":"Raymond Piller","fromEmail":"ray@vertigion.com","sentAt":"2014-03-25T19:37:36Z","receivedAt":"2014-03-25T19:37:36Z","isPatch":false,"sender":{"key":"ray@vertigion.com","avatar":null},"body":"I'm trying to ensure that a specific file is signed properly before\nallowing the file to be commited.  I'm using powershell to do this,\nbut this isn't a powershell issue.  Here's the command I'm using to do\nthe check:\n\n    /c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command\n\"If ((Get-AuthenticodeSignature .\\test.ps1).Status -ne 'Valid') { Exit\n1 }\"\n\nNote: I've tried with variation of the following powershell switches:\n\n    -NoLogo -NonInteractive -NoProfile\n\nAt first, the appeared to be that the exit code is lost and is always\n0.  After further investigation, it appears that this command doesn't\neven run.  For example, here's a test command:\n\n    /c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command\n\"Get-Location | Out-File C:\\Temp\\test.txt\"\n\nThis *test* command runs fine when executed from the GitBash shell;\nthe test.txt file is created.  When in the pre-commit hook file, it\nfails to create the test.txt file; this is technically TortoiseGit\nrunning this part.\n\n**Question:**  On windows, how do I ensure that a specific file is\nsigned properly before allowing the file to be commited?  Is there a\nway to have the `gpg` command use the windows cert store for\nvalidation of a signature?\n\nI feel like this is a TortoiseGit issue, but wanted to bounce this on\nyou all.  I've submitted an issue:\nhttps://code.google.com/p/tortoisegit/issues/detail?id=2143\n\n--\n~Ray\n` ` ` ` ` ` ` ` ' ` ` ` ` ` ' ` ` ` ` ` ` `\nRaymond A. S. Piller\nhttp://Vertigion.com\n682-651-5653\n"}]}