Skip to content

Inconsistent experience when access root of psdrive #6773

@SteveL-MSFT

Description

@SteveL-MSFT
cd /Users/steve/test
mkdir Users
New-PSDrive -PSProvider FileSystem -Root /Users/steve/test -Name steve
cd steve:
cd /Users

What should happen? Today, if the path starts with a directory separator on Unix systems, we always treat it as a filesystem path so you would end up in /Users instead of steve:/Users. Workaround if you're in the PSDrive is to use ./Users (on Unix, on Windows the workaround isn't needed since every drive starts with a drive letter so there's no ambiguity, but cross-platform scripts would need to be aware of this).

Doesn't seem like much we can do here as assuming a root path means filesystem makes sense. However, as more PSProviders become availble (since SHiPS makes it much easier now to author them), this experience may or may not cause confusion.

For example, if Azure:/myfolder exists and you try cd /myfolder while in the Azure: drive, but /myfolder doesn't exist in the filesystem, you'll get an error. We don't try (and shouldn't) to find it in the psdrive if we don't find it it the filesystem. Instead, you get a cd : Cannot find path '/myfolder' because it does not exist error message (again, on Unix only).

Seeing if anyone in the community has any ideas on how to potentially improve this experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreWG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions