mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
fix tests not setting back $psdefaultparametervalues back correctly (#4892)
This commit is contained in:
@@ -13,12 +13,12 @@ Describe "Redirection operator now supports encoding changes" -Tags "CI" {
|
||||
# If out-file -encoding happens to have a default, be sure to
|
||||
# save it away
|
||||
$SavedValue = $null
|
||||
$oldDefaultParameterValues = $psDefaultParameterValues
|
||||
$oldDefaultParameterValues = $psDefaultParameterValues.Clone()
|
||||
$psDefaultParameterValues = @{}
|
||||
}
|
||||
AfterAll {
|
||||
# be sure to tidy up afterwards
|
||||
$psDefaultParameterValues = $oldDefaultParameterValues
|
||||
$global:psDefaultParameterValues = $oldDefaultParameterValues
|
||||
}
|
||||
BeforeEach {
|
||||
# start each test with a clean plate!
|
||||
|
||||
@@ -36,7 +36,7 @@ Describe "Certificate Provider tests" -Tags "CI" {
|
||||
AfterAll {
|
||||
if(!$IsWindows)
|
||||
{
|
||||
$PSdefaultParameterValues = $defaultParamValues
|
||||
$global:PSdefaultParameterValues = $defaultParamValues
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ Describe "Certificate Provider tests" -Tags "Feature" {
|
||||
}
|
||||
else
|
||||
{
|
||||
$PSdefaultParameterValues = $defaultParamValues
|
||||
$global:PSdefaultParameterValues = $defaultParamValues
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ Describe "CmsMessage cmdlets thorough tests" -Tags "Feature" {
|
||||
}
|
||||
else
|
||||
{
|
||||
$PSdefaultParameterValues = $defaultParamValues
|
||||
$global:PSdefaultParameterValues = $defaultParamValues
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Describe "SecureString conversion tests" -Tags "CI" {
|
||||
if ( ! $IsWindows ) { $PSdefaultParameterValues["it:pending"] = $true }
|
||||
}
|
||||
AfterAll {
|
||||
$PSdefaultParameterValues = $defaultParamValues
|
||||
$global:PSdefaultParameterValues = $defaultParamValues
|
||||
}
|
||||
|
||||
It "using null arguments to ConvertFrom-SecureString produces an exception" {
|
||||
|
||||
Reference in New Issue
Block a user