Skip to content

Get-Item with a drive's root dir stringifies incorrectly #10956

Closed

Description

This is a regression from Windows PowerShell.

When accessing a drive's root directory, an extra path separator is appended on stringification.

Steps to reproduce

$root = ('/', 'C:\')[$env:OS -eq 'Windows_NT']
Push-Location ('/', 'C:\')[$env:OS -eq 'Windows_NT']

(Get-Item /).ToString() | Should -Be $root
(Get-Item .).ToString() | Should -Be $root

Pop-Location 

Expected behavior

The tests should pass.

Actual behavior

The tests fails; e.g., on Windows:

Expected: 'C:\'
But was:  'C:\\'

Environment data

PowerShell Core 7.0.0-preview.5

Activity

  1. added
    Issue-Question
    on Oct 31, 2019
  2. added
    WG-Engine-Providers
    Issue-Bug
    and removed
    Issue-Question
    on Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-BugResolution-FixedWG-Engine-Providers

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions