You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Information missing from the Set-AuthenticodeSignature and Get-AuthenticodeSignature topics #3408
Parameter -Content is technically available, but the underlying functionality is not implemented, as also indicated by the source code; that is, you get error Set-AuthenticodeSignature : The method or operation is not implemented.
Missing from Get-AuthenticodeSignature:
Parameter -Content only properly processes a byte array if the bytes represent "Unicode" (UTF-16LE)-encoded characters. That is, passing the bytes of a file that uses any other encoding (UTF-8, "ANSI", ...) is not supported, and obscurely reports the input as NotSigned.
Description of parameter -SourcePathOrExtension is lacking:
Path to the file or file type of the content, on which digital signature is retrieved.
I can see wanting to supply the file path of the originating script, but when would you use the OrExtension ("file type of the content") part?
/// Gets or sets the file type of the byte array containing the content with
/// digital signature.
Also note that only values ending in .ps1, psm1, ... (irrespective of whether they refer to existing files) result in the output object properly reporting the signature status; any other values cause a fixed NotSigned status, irrespective of whether the bytes themselves represent code with a valid signature.
In general, it would help if the topics stated what the typical use case for -Content + -SourcePathOrExtension is.
Version(s) of document impacted
Impacts 6.next document
Impacts 6 document
Impacts 5.1 document
Impacts 5.0 document
Impacts 4.0 document
Impacts 3.0 document
Reason(s) for not selecting all version of documents
The documented feature was introduced in selected version of PowerShell
This issue only shows up in selected version of the document
I'd like to note that I spent a week on this issue. And only thanks to Michael Klement (@mklement0) I got an explanation what's going on. Ping me internally at alexbat for more details, if you'd like.
Description of parameter -SourcePathOrExtension is lacking:
Path to the file or file type of the content, on which digital signature is retrieved.
From the documentation, it's absolutely unclear indeed what is the purpose and the intended use of this parameter. I passed both $_.Name and [System.IO.Path]::GetExtension($_.Name) and both surprisingly worked.
Activity
abatishchev commentedon Dec 12, 2018
I'd like to note that I spent a week on this issue. And only thanks to Michael Klement (@mklement0) I got an explanation what's going on. Ping me internally at alexbat for more details, if you'd like.
From the documentation, it's absolutely unclear indeed what is the purpose and the intended use of this parameter. I passed both
$_.Nameand[System.IO.Path]::GetExtension($_.Name)and both surprisingly worked.abatishchev commentedon Sep 3, 2019
Bump. Would like to see any update or progress on this issue.
abatishchev commentedon Sep 13, 2019
Bump.
Fixes #3408 - content must be unicode (#5756)