GCI of extended-length path "\\?\" returns incorrect items
See original GitHub issueSteps to reproduce
Get-ChildItem -LiteralPath '\\?\D:\'
Get-ChildItem -LiteralPath '\\?\UNC\server\share'
Expected behavior
Gets the items in the specified location.
Actual behavior
Gets the items in the root of the current drive (e.g. C:\). Same cmdlet in PSVersion 5.1 gets the items in the specified location.
Environment data
Name Value
---- -----
PSVersion 7.1.1
PSEdition Core
GitCommitId 7.1.1
OS Microsoft Windows 10.0.14393
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Get-Childitem Long Path Issue - PowerShell
I am trying to return a list of files from a share with specific properties. The problem is with the character limitation for...
Read more >Random path errors when using extended-length prefix
IO. Directory]::Exists($path) returns false while path exists (but only when the error is happening)
Read more >Powershell, GCI bugging out? Non-empty Folder size ...
Specifies a path to one or more locations. Wildcards are accepted. The default location is the current directory (.). [Touch Me] happens to...
Read more >Get-ChildItem : The specified path, file name, or both are ...
Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters,...
Read more >Handle exception with long paths in Powershell
This script aims to get relative path and hash from files/folders and its subfolders. It works with some with others I get the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Definitely a bug that needs to be fixed in my opinion. #14078 doesn’t seem to include the specific problem this issue is about –
Get-ChildItem -LiteralPath '\\?\D:\'
shows files/folders underC:\
instead, so I think we should not close this issue as a dup.@SteveL-MSFT mentioned in https://github.com/PowerShell/PowerShell/issues/10805#issuecomment-579516971
I’m not sure if that statement also applies to this issue. Happy to see other people’s thoughts.
This issue has been marked as fixed and has not had any activity for 1 day. It has been closed for housekeeping purposes.