-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Resolve-Path with -Relative parameter should allow the use of a reference path #8435
Comments
Totally agree. We shouldn't have to |
You could use
This also has the benefit of correcting the directory sep char for the platform. |
@rkeithhill I don't think that'll work for this particular problem. It appears that the
|
This is my workaround:
|
This would help mitigate #10509 . Would love to see some traction on this, as it seems pretty simple. |
What if we add new parameter for base path |
🎉This issue was addressed in #19358, which has now been successfully released as Handy links: |
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.txt
file locations relative todir
, I would have to do something like this:Ideally, I would like to do something like this:
The text was updated successfully, but these errors were encountered: