Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Nov 21, 2019

PR Summary

Previous code was incorrectly detecting if $PSHOME was in front using .Contains() since a preview would have the path "$PSHOME\preview" in front. Since this affects startup, we don't want to do a bunch of string manipulation with Split() so to cover the most common case we just check if the start of $env:PATH contains $PSHOME with the path separator and if not add to front. Two scenarios that aren't covered:

  • If $PSHOME is somewhere else in $env:PATH it will be duplicated. This is unlikely and will just have a small perf impact searching $env:PATH.
  • If $env:PATH only contains $PSHOME (without the path separator), then it'll also be duplicated, but this is also unlikely with minor impact.

PR Context

PR Checklist

@TravisEz13 TravisEz13 added this to the rc.1-consider milestone Nov 23, 2019
@TravisEz13 TravisEz13 added MustHave CL-Engine Indicates that a PR should be marked as an engine change in the Change Log labels Nov 23, 2019
@TravisEz13 TravisEz13 merged commit a1c2d3c into PowerShell:master Nov 23, 2019
@SteveL-MSFT SteveL-MSFT deleted the pshome-path branch November 27, 2019 16:12
@TravisEz13 TravisEz13 modified the milestones: rc.1-approved, 7.0.0-rc.1 Dec 4, 2019
@ghost
Copy link

ghost commented Dec 16, 2019

🎉v7.0.0-rc.1 has been released which incorporates this pull request.:tada:

Handy links:

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

Labels

CL-Engine Indicates that a PR should be marked as an engine change in the Change Log MustHave

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants