FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix GetCorrectCasedPath() to first check if any system file entries is returned before calling First() by SteveL-MSFT · Pull Request #10930 · PowerShell/PowerShell · GitHub

Fix GetCorrectCasedPath() to first check if any system file entries is returned before calling First() - #10930

Merged
Andrew (anmenaga) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:getexactpath
Oct 31, 2019
Merged

Fix GetCorrectCasedPath() to first check if any system file entries is returned before calling First()#10930
Andrew (anmenaga) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:getexactpath

Conversation

Steve Lee (SteveL-MSFT) commented Oct 29, 2019
edited
Loading

Copy link
Copy Markdown
Member

PR Summary

On WSL, if you have a folder in /mnt/c/Users/steve/Blah and try: test-path /mnt/c/Users/steve/blah -pathtype container you get an error because .First() is being called on an empty string array. Fix is to check that the returned array contains something. Otherwise, just return the given path as some file system issue prevents correcting the casing. This issue seems to only repro on WSL (Windows Subsystem on Linux)

PR Checklist

Ilya (iSazonov) commented Oct 29, 2019
edited
Loading

Copy link
Copy Markdown
Collaborator

I can not repo on WSL1. Is the issue on WSL2?

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

WSL== Windows Subsystem for Linux ? it would be good to mention this in PR description.

Andrew (anmenaga) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 30, 2019
Andrew (anmenaga) added this to the 7.0.0-preview.6 milestone Oct 30, 2019
Andrew (anmenaga) merged commit 2297627 into PowerShell:master Oct 31, 2019
Steve Lee (SteveL-MSFT) deleted the getexactpath branch October 31, 2019 19:07

Copy link
Copy Markdown

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL