8000 Set-Location & Get-Item -LiteralPath Inconsistent On Files/Dirs With ?/* Characters · Issue #12299 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
Set-Location & Get-Item -LiteralPath Inconsistent On Files/Dirs With ?/* Characters #12299
@NoMoreFood

Description

@NoMoreFood

Steps to reproduce

Using PowerShell 7.0 on Linux or MacOS:

  1. Create an empty directory
  2. Create two sub directories called ":" and "?"
  3. Attempt to change location to '?'; the directory will actually change to the ':' directory.
  4. Attempt to Get-Item on the '?' directory; the directory information will be for the ':' directory.

Expected behavior

PS /tmp> New-Item -ItemType Directory '/tmp/dir/:' | Out-Null
PS /tmp> New-Item -ItemType Directory '/tmp/dir/?' | Out-Null
PS /tmp> Set-Location -LiteralPath '/tmp/dir/?'
PS /tmp/dir/?> Get-Item -LiteralPath '/tmp/dir/?'


    Directory: /tmp/dir

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          04/10/2020    19:45                ?

Actual behavior

PS /tmp> New-Item -ItemType Directory '/tmp/dir/:' | Out-Null
PS /tmp> New-Item -ItemType Directory '/tmp/dir/?' | Out-Null
PS /tmp> Set-Location -LiteralPath '/tmp/dir/?'
PS /tmp/dir/:> Get-Item -LiteralPath '/tmp/dir/?'


    Directory: /tmp/dir

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          04/10/2020    19:45                :

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0
PSEdition                      Core
GitCommitId                    7.0.0
OS                             Linux 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-FileSystem-Providerspecific to the FileSystem providerIssue-BugIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreWG-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

      0