PowerShell Logo Small

Get-AuthenticodeSignature



This is the built-in help made by Microsoft for the command 'Get-AuthenticodeSignature', in PowerShell version 2 - as retrieved from Windows version 'Microsoft® Windows Vista™ Ultimate ' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Gets information about the Authenticode signature in a file.

SYNTAX


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



Search powershellhelp.space

DESCRIPTION


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



<

RELATED LINKS

Online version: http://go.microsoft.com/fwlink/?LinkID=113307
about_Signing
about_Execution_Policies
Set-AuthenticodeSignature
Get-ExecutionPolicy
Set-ExecutionPolicy

REMARKS

<

Examples


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

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



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








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

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



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








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

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



Description
-----------
This command lists all of the files in the $pshome directory that have a valid Authenticode signature. The $pshome automatic variable contains th
e 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".