Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-Item.Tests.ps1 handles finding multiple ping executables. #6120

Merged
merged 3 commits into from Feb 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could have done Select-Object -first 1 -ExpandProperty Source

$redirectFile = Join-Path -Path $TestDrive -ChildPath "redirect2.txt"

if ($IsWindows) {
Expand Down