Skip to content

cd-ing to a new drive and back does not restore path #6749

Closed

Description

@rjmholt

Steps to reproduce

C:\Users\me\Documents> cd Z:
Z:\> cd C:

Expected behavior

Z:\> cd C:
C:\Users\me\Documents>

Actual behavior

Z:\> cd C:
C:\>

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0-preview.1
PSEdition                      Core
GitCommitId                    v6.1.0-preview.1-99-g35d8de927b8e408461a5b4fc40ba20016c68433e
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

It looks like #6600 caused a regression. It seems to be Windows only. I tested with a9781de with no repro and then with 35d8de9 to successfully repro.

Credit to Jianyun (@jianyunt).

Activity

  1. added
    Issue-Bug
    WG-Engine-Providers
    on Apr 26, 2018
  2. iSazonov commented on Apr 27, 2018

    @iSazonov
    Collaborator

    We need add new tests for this but I guess CI has only one filesystem drive.

  3. GeeLaw commented on Apr 27, 2018

    @GeeLaw

    Ilya (@iSazonov) We could use New-PSDrive -Name TestSetLocation -Provider FileSystem -Root Path\To\Root and later Remove-PSDrive -Name TestSetLocation later. Alternatively, we could use subst.exe for Windows.

  4. iSazonov commented on Apr 27, 2018

    @iSazonov
    Collaborator

    Ji Luo (@GeeLaw) Thanks! I guess we could use New-PSDrive -Name "Z" -Provider FileSystem -Root Path\To\Root - seems one char name can be important in the test.

  5. iSazonov commented on Apr 29, 2018

    @iSazonov
    Collaborator

    @mcbobke Feel free push PR - now we know what tests we need to add to exclude a regression.

  6. added a commit that references this issue on Apr 30, 2018
  7. added a commit that references this issue on Aug 6, 2026
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-Engine-Providers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions