Skip to content

Get-ChildItem c: throws an error. #7032

Closed

Description

@sethvs

When using Get-ChildItem with drive name without a backslash, i.e. c: the error is thrown.

Steps to reproduce

Get-ChildItem c:

Expected behavior

Lists the content of current directory on the specified drive.

Actual behavior

Get-ChildItem : Cannot find path 'C:\C:\' because it does not exist.
At line:1 char:1
+ Get-ChildItem c:
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (C:\C:\:String) [Get-ChildItem], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.1.0-preview.701
PSEdition                      Core
GitCommitId                    v6.1.0-preview.701
OS                             Microsoft Windows 10.0.17134
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Activity

  1. added
    Issue-Bug
    on Jun 9, 2018
  2. iSazonov commented on Jun 9, 2018

    @iSazonov
    Collaborator

    It is a regression after 6.0.1 - we should find the bad commit before fix.

  3. sethvs commented on Jun 12, 2018

    @sethvs
    ContributorAuthor

    Can it be #6774 ?

  4. MaximoTrinidad commented on Jun 12, 2018

    @MaximoTrinidad

    So, is this after Preview.2?

    There's no errors on 6.1.0-Preview.2. It runs as expected.

    PS C:\> $PSVersionTable
    
    Name                           Value
    ----                           -----
    PSVersion                      6.1.0-preview.2
    PSEdition                      Core
    GitCommitId                    v6.1.0-preview.2
    OS                             Microsoft Windows 10.0.17686
    Platform                       Win32NT
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    
    
    PS C:\> Get-ChildItem c:
    
    
        Directory: C:\
    
    
    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    d-----       10/17/2017  11:22 AM                AppData
    d-----        5/14/2018   8:48 PM                AzureApp01
    d-----       11/30/2017  12:27 PM                CrossPlatScripts
    d-----        11/5/2017   9:08 PM                data
    d-----        5/10/2018   1:31 PM                GlobalAzureBootCamp2018
    d-----         6/4/2018  11:32 AM                GoPro
    :
    

    getchilditem_ok_2018-06-12_13-25-07

  5. sethvs commented on Jun 12, 2018

    @sethvs
    ContributorAuthor

    Maximo Trinidad (@MaximoTrinidad) Yes, on 6.1.0-Preview.2 it works.

  6. iSazonov commented on Jun 13, 2018

    @iSazonov
    Collaborator

    Maximo Trinidad (@MaximoTrinidad) Could you please help to find the post Preview2 broken commit? We could use saved artifacts from CI Appveyor.

  7. sethvs commented on Jun 13, 2018

    @sethvs
    ContributorAuthor

    Ilya (@iSazonov) I believe it is b101d52

  8. iSazonov commented on Jun 13, 2018

    @iSazonov
    Collaborator

    PR with regression is #6774

    Dongbo Wang (@daxian-dbw) Rob Holt (@rjmholt) @mcbobke

  9. iSazonov commented on Jun 14, 2018

    @iSazonov
    Collaborator

    I think the code path should be the same for all providers - compare dir c:,dir alias:, dir hklm:.

    /cc Michael Klement (@mklement0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugResolution-FixedWG-Cmdlets

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions