Registry provider: key names "." and ".." aren't supported in PS drive paths due to filesystem-like path normalization #9451
Labels
Area-FileSystem-Provider
specific to the FileSystem provider
Issue-Question
ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a
Resolution-No Activity
Issue has had no activity for 6 months or more
WG-Engine-Providers
built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
If you use a path with a key literally named
.
or..
that is based on one of the registry drive provider's drives such asHKCU:
, these names are currently misinterpreted as referring to the current and parent "directory" respectively, as in the filesystem.The workaround is to use a provider-native path via the
registry::
prefix.If it's too late to change this behavior and perhaps people rely on it, expecting filesystem-analogous behavior, the pitfall - and workaround - should be documented.
Note that creating a key named
.
is not a hypothetical example; you need it to define a file type for extension-less file names, for instance (HKEY_CLASSES_ROOT\.
)Steps to reproduce (on Windows)
Note: The same applies analogously to a key literally named
'..'
.Expected behavior
The test should pass.
Actual behavior
The test fails:
Environment data
The text was updated successfully, but these errors were encountered: