I have a build script that signs a digital certificate file (Microsoft Authenticode). I want to create a test script that checks that the file is successfully signed. This is sufficient with a boolean indicating the presence of any signature in the file.
Can I do this with PowerShell without any extensions? If not, what do I need?
Try Get-AuthenticodeSignature-cmdlet
Get-AuthenticodeSignature
(Get-AuthenticodeSignature "C:\windows\explorer.exe").Status -eq 'Valid' True (Get-AuthenticodeSignature "D:\notes.txt").Status -eq 'Valid' False
You can simply call signtool.exe to check the result.
check-check ( npm).
: npm install -g sign-check
npm install -g sign-check
: sign-check 'path/to/file'
sign-check 'path/to/file'