Fix incorrect test cases in ExecutionPolicy.Tests.ps1 (#19485)

This commit is contained in:
xtqqczze
2023-05-09 00:12:07 +00:00
committed by GitHub
parent 1c8b58c0b4
commit d314b0b1c0
@@ -67,9 +67,6 @@ try {
Set-ExecutionPolicy -ExecutionPolicy Restricted -Force -ErrorAction Stop
(Get-Help -Name Get-Disk -ErrorAction Stop).Name | Should -Be 'Get-Disk'
}
catch {
$_.ToString | Should -Be null
}
finally
{
Set-ExecutionPolicy $currentExecutionPolicy -Force
@@ -532,10 +529,10 @@ ZoneId=$FileType
Context "Prereq: Validate that 'Microsoft.PowerShell.Archive' is signed" {
It "'Microsoft.PowerShell.Archive' should have a signature" {
$script:archiveAllCert | Should -Not -Be null
$script:archiveAllCert | Should -Not -Be $null
}
It "'Microsoft.PowerShell.Archive' should have a valid signature" {
$script:archiveCert | Should -Not -Be null
$script:archiveCert | Should -Not -Be $null
}
}