Title: New-Item symlinks cannot be created if destination (target) is non-existent or not accessible · Issue #9067 · PowerShell/PowerShell · GitHub
Open Graph Title: New-Item symlinks cannot be created if destination (target) is non-existent or not accessible · Issue #9067 · PowerShell/PowerShell
X Title: New-Item symlinks cannot be created if destination (target) is non-existent or not accessible · Issue #9067 · PowerShell/PowerShell
Description: Steps to reproduce new-item -type symboliclink -name "hello" -target "Z:\" Because I have to execute this as an administrator, my Z: drive is not attached, and so PowerShell responds with an error. new-item : Cannot find drive. A drive w...
Open Graph Description: Steps to reproduce new-item -type symboliclink -name "hello" -target "Z:\" Because I have to execute this as an administrator, my Z: drive is not attached, and so PowerShell responds with an error....
X Description: Steps to reproduce new-item -type symboliclink -name "hello" -target "Z:\" Because I have to execute this as an administrator, my Z: drive is not attached, and so PowerShell res...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/9067
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"New-Item symlinks cannot be created if destination (target) is non-existent or not accessible","articleBody":"# Steps to reproduce\r\n\r\n```powershell\r\nnew-item -type symboliclink -name \"hello\" -target \"Z:\\\"\r\n```\r\n\r\nBecause I have to execute this as an administrator, my Z: drive is not attached, and so PowerShell responds with an error.\r\n\r\n```\r\nnew-item : Cannot find drive. A drive with the name 'Z' does not exist.\r\nAt line:1 char:1\r\n+ new-item -type symboliclink -name \"hello\" -target \"Z:\\\"\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n+ CategoryInfo : ObjectNotFound: (Z:String) [New-Item], DriveNotFoundException\r\n+ FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.NewItemCommand\r\n```\r\n\r\nIt appears this was thought to be fixed in #801, but evidently it didn't include non-existent drives.\r\n\r\nInstead I have to resort to CMD MKLINK.\r\n\r\n```PowerShell\r\ncmd\r\n> mklink /D \"hello\" \"Z:\\\"\r\n> exit\r\n```\r\n\r\n# Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```none\r\nName Value\r\n---- -----\r\nPSVersion 6.2.0-rc.1\r\nPSEdition Core\r\nGitCommitId 6.2.0-rc.1\r\nOS Microsoft Windows 10.0.17763\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n\r\nEdit 1: fixed spellings, changed parameter to '-target'.","author":{"url":"https://github.com/msftrncs","@type":"Person","name":"msftrncs"},"datePublished":"2019-03-05T23:12:50Z","url":"https://github.com/PowerShell/PowerShell/issues/9067"}
| 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:8f873086-2b5c-741e-b95e-787034a10734 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A60A:A7B59:20FA40:2D0BD2:6AFD51CB |
| html-safe-nonce | bcf8c5f211e346d6e20d3965d086cdcde3db699c2a017b4dfb4ba5d7d44ab505 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjBBOkE3QjU5OjIwRkE0MDoyRDBCRDI6NkFGRDUxQ0IiLCJ2aXNpdG9yX2lkIjoiNjM4MjgyNDQyMTYzMDc1OTM3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ab1f0e3f41c47e49a0cb3b7206ab7fb895eb486822fe27458cfbcd9c50bde0c9 |
| hovercard-subject-tag | issue:417545560 |
| 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/9067/issue_layout |
| twitter:image | https://opengraph.githubassets.com/26e01be580151bd63dfb19b8fb2022de8e07a03099df03b6ac48d95b2fcaeec5/PowerShell/PowerShell/issues/9067 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/26e01be580151bd63dfb19b8fb2022de8e07a03099df03b6ac48d95b2fcaeec5/PowerShell/PowerShell/issues/9067 |
| og:image:alt | Steps to reproduce new-item -type symboliclink -name "hello" -target "Z:\" Because I have to execute this as an administrator, my Z: drive is not attached, and so PowerShell responds with an error.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | msftrncs |
| 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