Skip to content

Commit d6516ef

Browse files
authored
Replace ErrorAction SilentlyContinue with Ignore (#2318)
1 parent 8d4d933 commit d6516ef

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/functions/Environment.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ function GetPesterOs {
88
if ((GetPesterPsVersion) -lt 6) {
99
'Windows'
1010
}
11-
elseif (& $SafeCommands['Get-Variable'] -Name 'IsWindows' -ErrorAction 'SilentlyContinue' -ValueOnly ) {
11+
elseif (& $SafeCommands['Get-Variable'] -Name 'IsWindows' -ErrorAction 'Ignore' -ValueOnly ) {
1212
'Windows'
1313
}
14-
elseif (& $SafeCommands['Get-Variable'] -Name 'IsMacOS' -ErrorAction 'SilentlyContinue' -ValueOnly ) {
14+
elseif (& $SafeCommands['Get-Variable'] -Name 'IsMacOS' -ErrorAction 'Ignore' -ValueOnly ) {
1515
'macOS'
1616
}
17-
elseif (& $SafeCommands['Get-Variable'] -Name 'IsLinux' -ErrorAction 'SilentlyContinue' -ValueOnly ) {
17+
elseif (& $SafeCommands['Get-Variable'] -Name 'IsLinux' -ErrorAction 'Ignore' -ValueOnly ) {
1818
'Linux'
1919
}
2020
else {

src/functions/Get-ShouldOperator.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
END {
7373
if ($Name) {
7474
$operator = $AssertionOperators.Values | & $SafeCommands['Where-Object'] { $Name -eq $_.Name -or $_.Alias -contains $Name }
75-
$commandInfo = & $SafeCommands['Get-Command'] -Name $operator.InternalName -ErrorAction SilentlyContinue
76-
$help = & $SafeCommands['Get-Help'] -Name $operator.InternalName -Examples -ErrorAction SilentlyContinue
75+
$commandInfo = & $SafeCommands['Get-Command'] -Name $operator.InternalName -ErrorAction Ignore
76+
$help = & $SafeCommands['Get-Help'] -Name $operator.InternalName -Examples -ErrorAction Ignore
7777

7878
if (($help | & $SafeCommands['Measure-Object']).Count -ne 1) {
7979
& $SafeCommands['Write-Warning'] ("No help found for Should operator '{0}'" -f ((Get-AssertionOperatorEntry $Name).InternalName))

src/functions/Pester.Debugging.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
}
2525

2626
$scope = 0
27-
while ($null -eq (& $safeGetVariable -Name Error -Scope $scope -ErrorAction SilentlyContinue)) {
27+
while ($null -eq (& $safeGetVariable -Name Error -Scope $scope -ErrorAction Ignore)) {
2828
$scope++
2929
}
3030

0 commit comments

Comments
 (0)