-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module
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
Note:
-
I think
-RelativeBasePath
shouldn't even accept wildcard expressions, so to me the preferable resolution is to simply treat-RelativePath
arguments as literal paths. (Currently, a wildcard is accepted, but only if it resolves to exactly one item).- There is precedent for making such a - technically breaking - change, e.g the
-OutFile
parameter ofInvoke-WebRequest
and-InvokeRestMethod
, which used to accept wildcards, but now interprets paths literally - see Make-OutFile
param in web cmdlets to work like -LiteralPath #11701 (comment)
- There is precedent for making such a - technically breaking - change, e.g the
-
Doing so would make the problem at hand go away; if this is decided against, at least the inconsistency below must be fixed.
# Matching with *literal* path.
Resolve-Path System32 -Relative -RelativeBasePath C:\Windows
# Matching the same path *via wildcard*
Resolve-Path System32 -Relative -RelativeBasePath C:\Window[s]
Expected behavior
.\System32
.\System32
Actual behavior
.\System32
..\Windows\System32
That is, even though in both commands C:\Windows
was ultimately used as the base path, the wildcard matching resulted in different output.
Error details
No response
Environment data
PowerShell 7.4.0
Visuals
No response
Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module