Title: Proposal: Resolve-Path with -Relative parameter should allow the use of a reference path · Issue #8435 · PowerShell/PowerShell · GitHub
Open Graph Title: Proposal: Resolve-Path with -Relative parameter should allow the use of a reference path · Issue #8435 · PowerShell/PowerShell
X Title: Proposal: Resolve-Path with -Relative parameter should allow the use of a reference path · Issue #8435 · PowerShell/PowerShell
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...
Open Graph 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...
X 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...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/8435
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal: Resolve-Path with -Relative parameter should allow the use of a reference path","articleBody":"# Summary of the new feature/enhancement\r\n\r\nAs 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. \r\n\r\n# Proposed technical implementation details\r\n\r\nAssuming I have a directory like this:\r\n\r\n```none\r\n/MyProject\r\n |-/dir\r\n |-test_1.txt\r\n |-test_2.txt\r\n |-/subdir\r\n |-test_3.txt\r\n```\r\n\r\nCurrently, 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:\r\n\r\n\r\n```powershell\r\n/MyProject\u003e cd dir\r\n/MyProject/dir\u003e Get-ChildItem -Recurse -Include \"*.txt\" | Resolve-Path -Relative\r\n./subdir/test_3.txt\r\n./test_1.txt\r\n./test_2.txt\r\n/MyProject/dir\u003e cd ..\r\n```\r\n\r\nIdeally, I would like to do something like this:\r\n\r\n```powershell\r\n/MyProject\u003e Get-ChildItem .\\dir -Recurse -Include \"*.txt\" | Resolve-Path -Relative -ReferencePath .\\dir\r\n./subdir/test_3.txt\r\n./test_1.txt\r\n./test_2.txt\r\n```","author":{"url":"https://github.com/terrabitz","@type":"Person","name":"terrabitz"},"datePublished":"2018-12-10T02:21:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/8435/PowerShell/issues/8435"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e04e0422-94eb-4de1-2c63-1baeeb1e6955 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B70:76D89:8EB23:C3D22:6A5463A7 |
| html-safe-nonce | bec879bdd1a7da02d4728a662c4a9339006ada8f7126e4602ea0d79926bcffe8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjcwOjc2RDg5OjhFQjIzOkMzRDIyOjZBNTQ2M0E3IiwidmlzaXRvcl9pZCI6IjQ0NTYwOTM0ODU1MTk2MjcxNzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d3978be6da2acbe4d8b0875adbb8374888e1fc585251e8330a939153c5b6af14 |
| hovercard-subject-tag | issue:389106351 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/8435/issue_layout |
| twitter:image | https://opengraph.githubassets.com/464560d77f602217b9bf5dc19c5cac457b616b19b8213a71614fbd7dd81c2db8/PowerShell/PowerShell/issues/8435 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/464560d77f602217b9bf5dc19c5cac457b616b19b8213a71614fbd7dd81c2db8/PowerShell/PowerShell/issues/8435 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | terrabitz |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6d28624802c2f7d9500239dd6870ed7031b7353b |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width