Get-AuthenticodeSignature
Use Get-AuthenticodeSignature to read a file's signature status: Valid, NotSigned, HashMismatch, NotTrusted, NotSupportedFileFormat, or UnknownError.
Documentation: Microsoft Learn — Get-AuthenticodeSignature
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-AuthenticodeSignature [-FilePath] <String[]> [<CommonParameters>]- Stage 1Get-AuthenticodeSignature
-FilePath
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Select Status, StatusMessage
Show reference output
Sample output · fictional data, shaped like the real thing
SignerCertificate Status StatusMessage Path ----------------- ------ ------------- ---- CN=Microsoft Corporation, O=Microsoft... Valid Signature verified script.ps1
Get-ChildItem -NoElement
Show reference output
Sample output · fictional data, shaped like the real thing
Count Name ----- ---- 2 SampleA 1 SampleB
Select Status, SignerCertificate
Show reference output
Sample output · fictional data, shaped like the real thing
SignerCertificate Status StatusMessage Path ----------------- ------ ------------- ---- CN=Microsoft Corporation, O=Microsoft... Valid Signature verified script.ps1
Signature statuses
Every result carries a Status. Here is what each value means and what to do about it.
| Status | What it means | What to do |
|---|---|---|
Valid | The file is signed, the signature is intact, and the certificate chain is trusted. | The signature verified — treat the file as untampered by this check. |
NotSigned | The file has no digital signature at all. | Normal for most scripts. Decide by your execution policy and how much you trust the source. |
HashMismatch | The file was modified after it was signed — content no longer matches the signature. | Do not run it. Investigate what changed before trusting the file. |
NotTrusted | The file is signed, but the signing certificate is not trusted on this machine. | Trust the publisher's certificate or verify the file's origin another way. |
NotSupportedFileFormat | The file type cannot carry an Authenticode signature. | Expected for non-executable formats — nothing is wrong with the file. |
UnknownError | The status could not be determined, usually because the certificate chain cannot be built. | Check trust configuration — a file Valid on one machine can be UnknownError on another purely because of trust. |
Parameters
Parameter definitions:
-FilePath
Recap
Get-AuthenticodeSignature Use Get-AuthenticodeSignature to read a file's signature status: Valid, NotSigned, HashMismatch, NotTrusted, NotSupportedFileFormat, or UnknownError.
Next: Set-AuthenticodeSignature