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

Wildcards don't work with Windows device paths #19439

Closed
5 tasks done
MartinGC94 opened this issue Apr 1, 2023 · 2 comments · Fixed by #19442
Closed
5 tasks done

Wildcards don't work with Windows device paths #19439

MartinGC94 opened this issue Apr 1, 2023 · 2 comments · Fixed by #19442
Labels
Area-FileSystem-Provider specific to the FileSystem provider Resolution-Fixed The issue is fixed.

Comments

@MartinGC94
Copy link
Contributor

Prerequisites

Steps to reproduce

  1. Run: Get-Volume -DriveLetter C | select Path to get a device path (in my case \\?\Volume{75e6ef3a-53fe-4b22-82de-b061b4abfb89}\)
  2. Run ls on the devicepath with a wildcard at the end like this:
ls '\\`?\Volume{75e6ef3a-53fe-4b22-82de-b061b4abfb89}\*'

Expected behavior

Output from the specified volume.

Actual behavior

No output.

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.0-preview.2
PSEdition                      Core
GitCommitId                    7.4.0-preview.2
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

@MartinGC94 MartinGC94 added the Needs-Triage The issue is new and needs to be triaged by a work group. label Apr 1, 2023
@iSazonov iSazonov added the Area-FileSystem-Provider specific to the FileSystem provider label Apr 2, 2023
@MartinGC94
Copy link
Contributor Author

MartinGC94 commented Apr 2, 2023

It seem the issue is caused by this check: https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/namespaces/FileSystemProvider.cs#L127 the path provided to that method does not have the trailing backslash so it reports that the directory \\.\Volume{75e6ef3a-53fe-4b22-82de-b061b4abfb89} does not exist, which is consistent with how the win32 API handles such paths. If you add one more backslash then it work: ls '\\.\Volume{75e6ef3a-53fe-4b22-82de-b061b4abfb89}\\*'

GitHub
PowerShell for every system! Contribute to PowerShell/PowerShell development by creating an account on GitHub.

@ghost ghost added the In-PR Indicates that a PR is out for the issue label Apr 2, 2023
@ghost ghost added Resolution-Fixed The issue is fixed. and removed In-PR Indicates that a PR is out for the issue Needs-Triage The issue is new and needs to be triaged by a work group. labels May 15, 2023
@ghost
Copy link

ghost commented Jun 29, 2023

🎉This issue was addressed in #19442, which has now been successfully released as v7.4.0-preview.4.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-FileSystem-Provider specific to the FileSystem provider Resolution-Fixed The issue is fixed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants