Title: New-Item -ItemType SymbolicLink should support creating symlinks with relative paths · Issue #3500 · PowerShell/PowerShell · GitHub
Open Graph Title: New-Item -ItemType SymbolicLink should support creating symlinks with relative paths · Issue #3500 · PowerShell/PowerShell
X Title: New-Item -ItemType SymbolicLink should support creating symlinks with relative paths · Issue #3500 · PowerShell/PowerShell
Description: Being able to create symlinks using relative paths is an important feature that both the ln utility on Unix and cmd's built-in command mklink on Windows support. Currently, PowerShell invariably resolves the specified path to an absolute...
Open Graph Description: Being able to create symlinks using relative paths is an important feature that both the ln utility on Unix and cmd's built-in command mklink on Windows support. Currently, PowerShell invariably re...
X Description: Being able to create symlinks using relative paths is an important feature that both the ln utility on Unix and cmd's built-in command mklink on Windows support. Currently, PowerShell invariabl...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/3500
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"New-Item -ItemType SymbolicLink should support creating symlinks with relative paths","articleBody":"Being able to create symlinks using relative paths is an important feature that both the `ln` utility on Unix and cmd's built-in command `mklink` on Windows support.\r\n\r\nCurrently, PowerShell invariably resolves the specified path to an _absolute path_ when a symlink is created.\r\n(#801 brought us the ability to create symlinks to non-existing targets, but even they are invariably resolved to an absolute path when the symlink is created).\r\n\r\nInstead, the symlink should be defined with the target path _exactly as specified_.\r\n\r\nSteps to reproduce (Unix)\r\n------------------\r\n\r\n```powershell\r\n$null = New-Item -ItemType SymbolicLink /tmp/$PID -Target ./foo -Force\r\nreadlink /tmp/$PID\r\n```\r\n\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n```\r\n./foo\r\n```\r\n\r\nThe symlink should be defined with the target path exactly as specified.\r\n\r\nActual behavior\r\n---------------\r\n\r\n```\r\n/Users/jdoe/foo\r\n```\r\n\r\nThe symlink was unexpectedly defined with an absolute path.\r\n\r\nEnvironment data\r\n----------------\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```powershell\r\nPowerShell Core v6.0.0-alpha (v6.0.0-alpha.17) on Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2017-04-06T21:01:53Z","url":"https://github.com/PowerShell/PowerShell/issues/3500"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:d77a9af5-2c2f-15cd-7841-6de4c824d333 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB26:2A3987:1EF382:2B9EBA:6AFD51C7 |
| html-safe-nonce | 0f5e0f36ee53aabf2db4967d83945b4fcda55376b43ffedcc6a6d093e3648db2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjI2OjJBMzk4NzoxRUYzODI6MkI5RUJBOjZBRkQ1MUM3IiwidmlzaXRvcl9pZCI6Ijg2NjU5ODgyMTU3OTAxODY5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e63f8c2b86005ce9cbbd9d1ce5533bc914af80647c2c10ab20be3f564d1a92c1 |
| hovercard-subject-tag | issue:220032043 |
| 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/3500/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5df113dc9d1ac0cf30e8d051642092e3490eafe4ecd4b2e0a4ae1cd664ee92cf/PowerShell/PowerShell/issues/3500 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5df113dc9d1ac0cf30e8d051642092e3490eafe4ecd4b2e0a4ae1cd664ee92cf/PowerShell/PowerShell/issues/3500 |
| og:image:alt | Being able to create symlinks using relative paths is an important feature that both the ln utility on Unix and cmd's built-in command mklink on Windows support. Currently, PowerShell invariably re... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| 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 | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width