CmdID / PowerShell / Cmdlets / Get
Get-AuthenticodeSignature
Gets information about the Authenticode signature for a file. PowerShell reference
From the PowerShell reference 4 parameters
What it does
Gets information about the Authenticode signature for a file. This cmdlet is only available on the Windows platform. The Get-AuthenticodeSignature cmdlet gets information about the Authenticode signature for a file or file content as a byte array. If the file is both embedded signed and Windows catalog signed, the Windows catalog signature is used. If the file is not signed, the information is retrieved, but the fields are blank.
Get-AuthenticodeSignature [-FilePath] <String[]> [<CommonParameters>]Get-AuthenticodeSignature -LiteralPath <String[]> [<CommonParameters>]Get-AuthenticodeSignature -SourcePathOrExtension <String[]> -Content <Byte[]> [<CommonParameters>]
Get the Authenticode signature for a file
Get-AuthenticodeSignature -FilePath "C:\Test\NewScript.ps1"IdentifyGet the Authenticode signature for multiple files
Get-AuthenticodeSignature test.ps1, test1.ps1, sign-file.ps1, makexml.ps1IdentifyGet only valid Authenticode signatures for multiple files
Get-ChildItem $PSHOME\*.* |
ForEach-Object {Get-AuthenticodeSignature $_} |
Where-Object {$_.Status -eq "Valid"}IdentifyGet the Authenticode signature for a file content specified as byte array
$authenticodeSignatureParams = @{
Content = (Get-Content foo.ps1 -AsByteStream)
SourcePathorExtension = "ps1"
}
Get-AuthenticodeSignature @authenticodeSignatureParamsIdentifyIts page in the reference: Get-AuthenticodeSignature.
Parameters
-ContentContents of a file as a byte array for which the Authenticode signature is retrieved. This parameter must be used with SourcePathOrExtension parameter. Prior to PowerShell 7.4, the contents of the file must be in Unicode (UTF-16LE) format.-FilePathSpecifies the path to the file to examine. Wildcards are permitted, but they must lead to a single file. It is not necessary to type FilePath at the command line when you specify a value for this parameter.-LiteralPathSpecifies the path to the file being examined. Unlike FilePath, the value of the LiteralPath parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes an escape character, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape characters.-SourcePathOrExtensionPath to the file or file type of the content for which the Authenticode signature is retrieved. This parameter is used with Content where file content is passed as a byte array.