question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GCI of extended-length path "\\?\" returns incorrect items

See original GitHub issue

Steps 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
daxian-dbwcommented, Jan 27, 2021

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 under C:\ 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 get that users may want to use the \?\ legacy syntax, but it’s not clear to me how impactful that is to motivate spending the time to fix this.

I’m not sure if that statement also applies to this issue. Happy to see other people’s thoughts.

0reactions
msftbot[bot]commented, Apr 5, 2023

This issue has been marked as fixed and has not had any activity for 1 day. It has been closed for housekeeping purposes.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found