You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent experience when access root of psdrive #6773
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.
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.
To truly target a subdir. named : in this case, prefixing with ./ would then be required (Set-Location ./:/Users)
I don't think that's a real-world concern, however, especially given that this is already a problem with files / subdirs. whose names look like they start with a drive spec; e.g.:
PS> mkdir -p 'ab:cd'; Set-Location-LiteralPath 'ab:cd'Set-Location : Cannot find drive. A drive with the name 'ab' does not exist.
In this scenario prefixing with ./ already is a requirement.
Given the rarity of : in filenames, I think introducing support for :/ is an acceptable solution.
(Note that : serves as the entry separator in $env:PATH on Unix-like platforms, even though : is a legal filename character in the typical Linux / macOS filesystems.
On a side note: classic Mac OS used : as the path separator, and that heritage is still reflected in Finder, which translates : in filenames into /(!) in its GUI.)
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
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.
Activity
mklement0 commentedon Apr 29, 2018
How about allowing an initial
:to represent the current location's drive, without having to name it in full?In other words: start a path with
:/rather than just/if you want it to refer to the root of the current drive.The small caveat is that on Unix-like platforms it would take away the ability to directly target a subdir. literally named
:, which currently works:To truly target a subdir. named
:in this case, prefixing with./would then be required (Set-Location ./:/Users)I don't think that's a real-world concern, however, especially given that this is already a problem with files / subdirs. whose names look like they start with a drive spec; e.g.:
In this scenario prefixing with
./already is a requirement.Given the rarity of
:in filenames, I think introducing support for:/is an acceptable solution.(Note that
:serves as the entry separator in$env:PATHon Unix-like platforms, even though:is a legal filename character in the typical Linux / macOS filesystems.On a side note: classic Mac OS used
:as the path separator, and that heritage is still reflected in Finder, which translates:in filenames into/(!) in its GUI.)microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 23, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.