Prerequisites
Steps to reproduce
If you use Resolve-Path to resolve the path under the registry provider, and -Relative to get relative path, everything is normal up to this point. But if you also use -RelativeBasePath to specify a registry path as base path, then an error will occur regardless.
Expected behavior
PS > Set-Location -LiteralPath 'HKCU:\Software\Classes'
PS > Resolve-Path -Path '.3g*' -Relative
.3g2
.3gp
.3gp2
.3gpp
PS > Resolve-Path -Path '.3g*' -Relative -RelativeBasePath .
.3g2
.3gp
.3gp2
.3gpp
PS > Resolve-Path -Path '.3g*' -Relative -RelativeBasePath $PWD.Path
.3g2
.3gp
.3gp2
.3gpp
PS > Resolve-Path -Path '.3g*' -Relative -RelativeBasePath HKCU:\Software\Classes
.3g2
.3gp
.3gp2
.3gpp
Actual behavior
PS > Set-Location -LiteralPath 'HKCU:\Software\Classes'
PS > Resolve-Path -Path '.3g*' -Relative
.3g2
.3gp
.3gp2
.3gpp
PS > Resolve-Path -Path '.3g*' -Relative -RelativeBasePath .
Resolve-Path: Cannot find path 'HKCU:\Software\Classes\HKEY_CURRENT_USER\Software\Classes' because it does not exist.
PS > Resolve-Path -Path '.3g*' -Relative -RelativeBasePath $PWD.Path
Resolve-Path: Cannot find path 'HKCU:\Software\Classes\HKEY_CURRENT_USER\Software\Classes' because it does not exist.
PS > Resolve-Path -Path '.3g*' -Relative -RelativeBasePath HKCU:\Software\Classes
Resolve-Path: Cannot find path 'HKCU:\Software\Classes\HKEY_CURRENT_USER\Software\Classes' because it does not exist.
Error details
Environment data
Name Value
---- -----
PSVersion 7.6.2
PSEdition Core
GitCommitId 7.6.2
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Prerequisites
Steps to reproduce
If you use
Resolve-Pathto resolve the path under the registry provider, and-Relativeto get relative path, everything is normal up to this point. But if you also use-RelativeBasePathto specify a registry path as base path, then an error will occur regardless.Expected behavior
Actual behavior
Error details
Environment data
Visuals
No response