Skip to content

put command discovery before scripts for Unix - #5116

Merged
Mike Richmond (mirichmo) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:command-first
Oct 24, 2017
Merged

put command discovery before scripts for Unix#5116
Mike Richmond (mirichmo) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:command-first

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

Also cleaned up the NativeLinuxCommands.Tests.ps1 script on skipping tests

Fix #2095

$env:PATH = $originalPath
}

It "Should return a type of 'string' for hostname cmdlet" {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Now we skip the test - why?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This test was created a long time ago. I think it's actually not useful and is implicitly covered by tests that follow. I'll remove it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Closed.

@iSazonov Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM with one minor comment.

@anmenaga Andrew (anmenaga) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM
Why adding testdrive to $env:PATH is necessary?

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Andrew (@anmenaga) I was thinking that would be a good way for command discovery to find the "native command" and the powershell script to validate the command was executed over the script without polluting the current working directory.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Mike Richmond (@mirichmo) can you merge?

@daxian-dbw

Copy link
Copy Markdown
Member

Is this change only for Unix? The title seems so but the change is not guarded by #if UNIX.

@mirichmo

Copy link
Copy Markdown
Member

Dongbo Wang (@daxian-dbw) The code is guarded by a runtime Platform check.

@mirichmo
Mike Richmond (mirichmo) merged commit d85b9a4 into PowerShell:master Oct 24, 2017
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the command-first branch November 12, 2017 05:17
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
* put command discovery before scripts for Unix

* remove unnecessary test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants