mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Co-authored-by: Anam Navied <anam.naviyou@gmail.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
23 lines
868 B
PowerShell
23 lines
868 B
PowerShell
# 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'
|
|
}
|
|
}
|