Set-AuthenticodeSignature


Places an authenticode signature in an Ps script or other file.

Snap-In: Microsoft.PowerShell.Security

Syntax:

Set-AuthenticodeSignature

 [-FilePath] <String[]> [-Certificate] <X509Certificate2> [-IncludeChain <String>] [-TimestampServer <String>] [-Force] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-WhatIf] [-Confirm] 

Description:

The set-authenticodesignature Cmdlet places an authenticode signature in any file that has SIP support. In a Ps script file, this signature takes the form o f a block of text. This signature block indicates the end of the instructions that are executed in the script. No code shall be executed once the signature block is begun. If a signature exists in the file when this cmdlet is run, that signature is removed. The certificate is required, and if missing, the user shall be prompted to provide a certificate. However, in this case the user will be unable to enter a certificate, so the cmdlet will fail. If the certificate is invalid or not valid for signing, set-authenticodesignature shall fail. Before a signature is set in the file and after the certificate has been validated, the value of the Boolean shell variable "SigningApproved" must checked. If this variable is unset or set to something other than true, the ShouldProcess method shall prompt the user to confirm the signing of the script. If TimeStampServer is set, this indicates that the designated URL should be use d to acquire a TimeStamp for the signature. The "IncludeChain" parameter indicates how much of the certificate trust-chain to embed in the signature block. The three choices allowed for this parameter are: none Only the signer's certificate shall be encoded and embedded into the script file. notroot All certificates in the signer's trust-chain, except for the root certificate, shall be encoded and embedded into the script file. fullchain All certificates in the signer's trust-chain including the root certificate shall be encoded and embedded into the script file.



Windows PowerShell. TFM
Internet Forensics
ISBN: 982131445
EAN: 2147483647
Year: 2004
Pages: 289

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net