Get-AuthenticodeSignature 
	获取有关文件的验证码签名的信息。
语法
		ByPath (默认值)
	 
	Get-AuthenticodeSignature
    [-FilePath] <String[]>
    [<CommonParameters>]
		ByLiteralPath
	  
	Get-AuthenticodeSignature
    -LiteralPath <String[]>
    [<CommonParameters>]
		ByContent
	 
	Get-AuthenticodeSignature
    -SourcePathOrExtension <String[]>
    -Content <Byte[]>
    [<CommonParameters>]
说明
此 cmdlet 仅在 Windows 平台上可用。
              Get-AuthenticodeSignature cmdlet 获取有关文件或文件内容作为字节数组的 Authenticode 签名的信息。
如果文件同时已嵌入签名且 Windows 目录已签名,则使用 Windows 目录签名。
如果未对文件进行签名,则会检索信息,但字段为空。
示例
示例 1:获取文件的验证码签名
Get-AuthenticodeSignature -FilePath "C:\Test\NewScript.ps1"
此命令获取有关 NewScript.ps1 文件中的 Authenticode 签名的信息。 它使用 FilePath 参数来指定文件。
示例 2:获取多个文件的验证码签名
Get-AuthenticodeSignature test.ps1, test1.ps1, sign-file.ps1, makexml.ps1
此命令获取有关命令行中列出的四个文件的 Authenticode 签名的信息。 在此示例中,省略 FilePath 参数的名称(可选)。
示例 3:仅获取多个文件的有效验证码签名
Get-ChildItem $PSHOME\*.* | ForEach-object {Get-AuthenticodeSignature $_} | Where-Object {$_.status -eq "Valid"}
此命令列出 $PSHOME 目录中具有有效验证码签名的所有文件。 
              $PSHOME 自动变量包含 PowerShell 安装目录的路径。
该命令使用 Get-ChildItem cmdlet 获取 $PSHOME 目录中的文件。 它使用 模式。 排除目录(尽管它还排除文件名中没有点的文件)。
该命令使用管道运算符(|)将 $PSHOME 中的文件发送到 ForEach-Object cmdlet,其中为每个文件调用 Get-AuthenticodeSignature。
              Get-AuthenticodeSignature 命令的结果将发送到仅选择状态为“有效”的签名对象的 Where-Object 命令。
示例 4:获取指定为字节数组的文件内容的验证码签名
Get-AuthenticodeSignature -Content (Get-Content foo.ps1 -AsByteStream) -SourcePathorExtension ps1
此命令获取有关文件内容的 Authenticode 签名的信息。 在此示例中,文件扩展名与文件的内容一起指定。
参数
-Content
作为检索验证码签名的字节数组的文件的内容。 此参数必须与 SourcePathOrExtension 参数一起使用。 文件的内容必须采用 Unicode(UTF-16LE)格式。
参数属性
| 类型: | Byte[] | 
| 默认值: | None | 
| 支持通配符: | False | 
| 不显示: | False | 
参数集
					ByContent 
					
				 
				| Position: | Named | 
| 必需: | True | 
| 来自管道的值: | False | 
| 来自管道的值(按属性名称): | True | 
| 来自剩余参数的值: | False | 
-FilePath 
		指定要检查的文件的路径。 允许通配符,但它们必须导致单个文件。 在为此参数指定值时,无需在命令行中键入 FilePath。
参数属性
| 类型: | String[] | 
| 默认值: | None | 
| 支持通配符: | True | 
| 不显示: | False | 
参数集
					ByPath 
					
				 
				| Position: | 0 | 
| 必需: | True | 
| 来自管道的值: | True | 
| 来自管道的值(按属性名称): | True | 
| 来自剩余参数的值: | False | 
-LiteralPath 
		指定要检查的文件的路径。 与 FilePath不同,LiteralPath 参数的值被按其键入的形式使用。 不会将任何字符解释为通配符。 如果路径包含转义字符,请将它括在单引号中。 单引号告知 PowerShell 不要将任何字符解释为转义字符。
参数属性
| 类型: | String[] | 
| 默认值: | None | 
| 支持通配符: | False | 
| 不显示: | False | 
| 别名: | PSPath | 
参数集
					ByLiteralPath 
					
				  
				| Position: | Named | 
| 必需: | True | 
| 来自管道的值: | False | 
| 来自管道的值(按属性名称): | True | 
| 来自剩余参数的值: | False | 
-SourcePathOrExtension  
		检索验证码签名的文件或文件类型的路径。 此参数用于 内容 其中文件内容作为字节数组传递。
参数属性
| 类型: | String[] | 
| 默认值: | None | 
| 支持通配符: | False | 
| 不显示: | False | 
参数集
					ByContent 
					
				 
				| Position: | Named | 
| 必需: | True | 
| 来自管道的值: | True | 
| 来自管道的值(按属性名称): | True | 
| 来自剩余参数的值: | False | 
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输入
String
可以通过管道将包含文件路径的字符串传递给 Get-AuthenticodeSignature。
输出
Signature
              Get-AuthenticodeSignature 为它获取的每个签名返回一个签名对象。
备注
此 cmdlet 仅在 Windows 平台上可用。
有关 PowerShell 中的验证码签名的信息,请参阅 about_Signing。