-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
I am currently experiencing an issue with Get-AuthenticodeSignature where when checking the signature with a direct file path the signature is valid, however when converting the same file into a byte array and attempting to run Get-AuthenticodeSignature against it, it reports no valid signature.
Get-AuthenticodeSignature -FilePath "~\Repos\Strapper\Strapper\Strapper.psm1"
<#
SignerCertificate Status StatusMessage Path
----------------- ------ ------------- ----
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF Valid Signature verified. Strapper.psm1
#>
Get-AuthenticodeSignature -Content (Get-Content -Path "~\Repos\Strapper\Strapper\Strapper.psm1" -AsByteStream) -SourcePathOrExtension psm1
<#
SignerCertificate Status StatusMessage Path
----------------- ------ ------------- ----
NotSigned The file psm1 is no… psm1
#>I assumed that this could have been a file extension issue, and it does appear to be replicated with even simple files, but changing the extension doesn't appear to fix the issue:
Get-AuthenticodeSignature -FilePath "~\Downloads\Get-Host.psm1"
<#
SignerCertificate Status StatusMessage Path
----------------- ------ ------------- ----
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF Valid Signature verified. Get-Host.psm1
#>
Get-AuthenticodeSignature -Content (Get-Content "~\Downloads\Get-Host.psm1" -AsByteStream) -SourcePathOrExtension psm1
<#
SignerCertificate Status StatusMessage Path
----------------- ------ ------------- ----
NotSigned The file psm1 is no… psm1
#>
Get-AuthenticodeSignature -FilePath "~\Downloads\Get-Host.ps1"
<#
SignerCertificate Status StatusMessage Path
----------------- ------ ------------- ----
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF Valid Signature verified. Get-Host.ps1
#>
Get-AuthenticodeSignature -Content (Get-Content "~\Downloads\Get-Host.ps1" -AsByteStream) -SourcePathOrExtension ps1
<#
SignerCertificate Status StatusMessage Path
----------------- ------ ------------- ----
NotSigned The file ps1 is not… ps1
#>Get-Host.psm1
Get-Host
# SIG # Begin signature block
# MIInbwYJKoZIhvcN...
# SIG # End signature blockExpected behavior
PS> Get-AuthenticodeSignature -Content (Get-Content -Path "~\Repos\Strapper\Strapper\Strapper.psm1" -AsByteStream) -SourcePathOrExtension psm1
SignerCertificate Status StatusMessage Path
----------------- ------ ------------- ----
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF Valid Signature verified. Strapper.psm1Actual behavior
PS> Get-AuthenticodeSignature -Content (Get-Content -Path "~\Repos\Strapper\Strapper\Strapper.psm1" -AsByteStream) -SourcePathOrExtension psm1
SignerCertificate Status StatusMessage Path
----------------- ------ ------------- ----
NotSigned The file psm1 is no… psm1Error details
No response
Environment data
PS> $PSVersionTable
Name Value
---- -----
PSVersion 7.3.0
PSEdition Core
GitCommitId 7.3.0
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
Metadata
Metadata
Assignees
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.
