-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
cd /Users/steve/test
mkdir Users
New-PSDrive -PSProvider FileSystem -Root /Users/steve/test -Name steve
cd steve:
cd /UsersWhat 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.