mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Use new Windows signature APIs from Microsoft.Security.Extensions package (#17159)
Co-authored-by: Anam Navied <anam.naviyou@gmail.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
This commit is contained in:
co-authored by
Anam Navied
Travis Plunk
parent
c2e11e9329
commit
8d453da283
@@ -0,0 +1,22 @@
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
|
||||
Describe "Windows platform file signatures" -Tags 'Feature' {
|
||||
|
||||
It "Verifies Get-AuthenticodeSignature returns correct signature for catalog signed file" -Skip:(!$IsWindows) {
|
||||
|
||||
if ($null -eq $env:windir) {
|
||||
throw "Expected Windows platform environment path variable '%windir%' not available."
|
||||
}
|
||||
|
||||
$filePath = Join-Path -Path $env:windir -ChildPath 'System32\ntdll.dll'
|
||||
if (! (Test-Path -Path $filePath)) {
|
||||
throw "Expected Windows PowerShell platform module path '$filePath' not found."
|
||||
}
|
||||
|
||||
$signature = Get-AuthenticodeSignature -FilePath $filePath
|
||||
$signature | Should -Not -BeNullOrEmpty
|
||||
$signature.Status | Should -BeExactly 'Valid'
|
||||
$signature.SignatureType | Should -BeExactly 'Catalog'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user