From d314b0b1c07dd41a3848fbdc305d7deebafc15ab Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 9 May 2023 01:12:07 +0100 Subject: [PATCH] Fix incorrect test cases in `ExecutionPolicy.Tests.ps1` (#19485) --- .../ExecutionPolicy.Tests.ps1 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 index 5a73055d41..9bcc0143d3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 @@ -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 } }