From d6e978f82a1b973b42c33044402adf3f14cba3cc Mon Sep 17 00:00:00 2001 From: Klaudia Algiz Date: Tue, 13 Feb 2018 17:01:24 -0800 Subject: [PATCH] Invoke-Item.Tests.ps1 handles finding multiple ping executables. (#6120) Invoke-Item.Tests.ps1 handles finding multiple ping executables. Fixes Issue #5220 --- .../Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 index e63f7d633..4c8f47a44 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 @@ -53,7 +53,8 @@ Describe "Invoke-Item basic tests" -Tags "Feature" { } It "Should invoke an executable file without error" { - $ping = Get-Command "ping" -CommandType Application | ForEach-Object Source + # In case there is a couple of ping executables, we take the first one. + $ping = (Get-Command "ping" -CommandType Application | Select-Object -First 1).Source $redirectFile = Join-Path -Path $TestDrive -ChildPath "redirect2.txt" if ($IsWindows) {