Skip to content

Cannot enumerate named pipes with Get-ChildItem #11898

@jborean93

Description

@jborean93

Steps to reproduce

On Windows run the following on PowerShell Core 7

# Works on 5, 6, but not 7
Get-ChildItem -Path '\\.\pipe\' | Select-Object -ExpandProperty FullName

# Works on all
[System.IO.Directory]::EnumerateFiles('\\.\pipe\')

Expected behavior

Get-ChildItem should return the named pipes on all PowerShell versions and match the output of the .NET method.

Actual behavior

PowerShell 5 and 6 output the named pipes but 7 outputs the FullName of contents of the root drive.

PS C:\Users\vagrant-domain> Get-ChildItem -Path '\\.\pipe\' | Select-Object -ExpandProperty FullName
C:\PerfLogs
C:\Program Files
C:\Program Files (x86)
C:\temp
C:\tools
C:\Users
C:\Windows

PS C:\Users\vagrant-domain> [System.IO.Directory]::EnumerateFiles('\\.\pipe\')
\\.\pipe\InitShutdown
\\.\pipe\lsass
\\.\pipe\ntsvcs
\\.\pipe\scerpc
...

Even using -LiteralPath does not work on v7 and Get-Item -Path '\\.\pipe\ (with and without the trailing ) fails to find a file

Environment data

# PS v5 (works)
Name                           Value
----                           -----
PSVersion                      5.1.17763.771
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.771
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

# PS v6 (works)
Name                           Value
----                           -----
PSVersion                      6.2.4
PSEdition                      Core
GitCommitId                    6.2.4
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

# PS v7 (doesn't work)
Name                           Value
----                           -----
PSVersion                      7.0.0-rc.2
PSEdition                      Core
GitCommitId                    7.0.0-rc.2
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

Labels

Area-FileSystem-Providerspecific to the FileSystem providerIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions