You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 ..
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:
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.txtfile locations relative todir, I would have to do something like this:Ideally, I would like to do something like this: