Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AuthenticodeSignature

Get-AuthenticodeSignature

microsoft.powershell.security.dll

Synopsis

Gets information about the Authenticode signature in a file.

Syntax

Get-AuthenticodeSignature [-FilePath] [<CommonParameters>]

Get-AuthenticodeSignature [-LiteralPath] [<CommonParameters>]

Detailed Description

The Get-AuthenticodeSignature cmdlet gets information about the Authenticode signature in a file. If the file is not signed, the information is retrieved, but the fields are blank.

Parameters

-FilePath <String[]>

Specifies the path to the file being examined. Wildcards are permitted, but they must lead to a single file. The parameter name ("FilePath") is optional.

Aliases

None

Required?

true

Position

1

Default value

Accept pipeline input?

true (ByValue, ByPropertyName)

Accept wildcard characters?

true

-LiteralPath <String[]>

Specifies 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 escape characters, enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences.

Aliases

None

Required?

true

Position

named

Default value

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

Input Type

System.String

Return Type

System.Management.Automation.Signature

Notes

For information about Authenticode signatures in Windows PowerShell, see about_Signing.

Examples

-------------------------- EXAMPLE 1 --------------------------

This command gets information about the Authenticode signature in the NewScript.ps1 file. It uses the FilePath parameter to specify the file.

PS C:\>get-AuthenticodeSignature -filepath C:\Test\NewScript.ps1

-------------------------- EXAMPLE 2 --------------------------

This command gets information about the Authenticode signature in the four files listed at the command line. In this command, the name of the FilePath parameter, which is optional, is omitted.

PS C:\>get-authenticodesignature test.ps1, test1.ps1, sign-file.ps1, makexml.ps1

-------------------------- EXAMPLE 3 --------------------------

This command lists all of the files in the $pshome directory that have a valid Authenticode signature. The $pshome automatic variable contains the path to the Windows PowerShell installation directory.

The command uses the Get-ChildItem cmdlet to get the files in the $pshome directory. It uses a pattern of *.* to exclude directories (although it also excludes files without a dot in the filename).

The command uses a pipeline operator (|) to send the files in $pshome to the Foreach-Object cmdlet, where Get-AuthenticodeSignature is called for each file.

The results of the Get-AuthenticodeSignature command are sent to a Where-Object command that selects only the signature objects with a status of "Valid".

PS C:\>get-childitem $pshome\*.* | foreach-object {Get-AuthenticodeSignature $_} | where {$_.status -eq "Valid"}

Online Version
Get-ExecutionPolicy
Set-AuthenticodeSignature
Set-ExecutionPolicy
about_Execution_Policies
about_Signing