From 4fd4522b8493e2c32ec5ee9af0fbc23a2485d9cd Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 16 Oct 2023 12:46:59 -0700 Subject: [PATCH] Suppress error output from `Set-Location` tests (#20499) --- .../Microsoft.PowerShell.Management/Set-Location.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 index f8a15d389e..73f3250ae8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 @@ -240,7 +240,7 @@ Describe "Set-Location" -Tags "CI" { It 'Should go to the parent folder on cd.. run' { Set-Location 'TestDrive:\' $ParentDir = (Get-Location).path - New-Item -Path 'TestDrive:\' -Name 'Directory1' -ItemType Directory + New-Item -Path 'TestDrive:\' -Name 'Directory1' -ItemType Directory -ErrorAction Ignore Set-Location 'TestDrive:\Directory1' cd.. (Get-Location).Path | Should -BeExactly $ParentDir @@ -256,7 +256,7 @@ Describe "Set-Location" -Tags "CI" { } It 'Should go to root of current drive on cd\ run (Linux/Mac)' -Skip:($IsWindows){ Set-Location 'TestDrive:\' - New-Item -Path 'TestDrive:\Directory1' -Name 'Directory2' -ItemType Directory + New-Item -Path 'TestDrive:\Directory1' -Name 'Directory2' -ItemType Directory -ErrorAction Ignore Set-Location 'TestDrive:\Directory1\Directory2' cd\ (Get-Location).Path | Should -BeExactly "/"