-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueResolution-DuplicateThe issue is a duplicate.The issue is a duplicate.
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Easily reproducible :
Convert-Path -Path "HKLM:SYSTEM\CurrentControlSet\Control\Session Manager\I/O System"
Expected behavior
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\I/O SystemActual behavior
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\I\O SystemError details
The forward back slash at the end (between I and O) is converted to a regular backslash.
This is due to the call to MakePath that is converting all the slashs from the child path.
https://github.com/cobbr/InsecurePowerShell/blob/fed7a542da3346c0f686157990e0c8a954b108c8/src/System.Management.Automation/namespaces/NavigationProviderBase.cs#L386
We should instead divide the path into multiple variables and then reassemble them.Environment data
Name Value
---- -----
PSVersion 7.4.6
PSEdition Core
GitCommitId 7.4.6
OS Microsoft Windows 10.0.26100
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response
Metadata
Metadata
Assignees
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueResolution-DuplicateThe issue is a duplicate.The issue is a duplicate.