-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management moduleWG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
Description
Summary of the new feature/enhancement
As a PowerShell developer, I want to be able to obtain the path of an item relative to a path that is not my current directory so that I can avoid changing my current location context for a relative directory lookup.
Proposed technical implementation details
Assuming I have a directory like this:
/MyProject
|-/dir
|-test_1.txt
|-test_2.txt
|-/subdir
|-test_3.txt
Currently, if I want to do a resolve a path relative to a different directory, I have to use set-location before calling Resolve-Path. For example, if I wanted to get all my .txt file locations relative to dir, I would have to do something like this:
/MyProject> cd dir
/MyProject/dir> Get-ChildItem -Recurse -Include "*.txt" | Resolve-Path -Relative
./subdir/test_3.txt
./test_1.txt
./test_2.txt
/MyProject/dir> cd ..Ideally, I would like to do something like this:
/MyProject> Get-ChildItem .\dir -Recurse -Include "*.txt" | Resolve-Path -Relative -ReferencePath .\dir
./subdir/test_3.txt
./test_1.txt
./test_2.txtmklement0, vexx32, Jaykul, jazzdelightsme, an-dr-eas-k and 5 more
Metadata
Metadata
Assignees
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management moduleWG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.built-in PowerShell providers such as FileSystem, Certificates, Registry, etc.