Title: New-PSDrive -Persist should report a platform-not-supported error (System.PlatformNotSupportedException) on Unix-like platforms · Issue #8250 · PowerShell/PowerShell · GitHub
Open Graph Title: New-PSDrive -Persist should report a platform-not-supported error (System.PlatformNotSupportedException) on Unix-like platforms · Issue #8250 · PowerShell/PowerShell
X Title: New-PSDrive -Persist should report a platform-not-supported error (System.PlatformNotSupportedException) on Unix-like platforms · Issue #8250 · PowerShell/PowerShell
Description: Using New-PSDrive -Persist, i.e. creating a persistent drive mapping at the OS level, is only supported on Windows. While trying to use it on Unix-like platforms does report an error, the error message is confusing (see below). Steps to ...
Open Graph Description: Using New-PSDrive -Persist, i.e. creating a persistent drive mapping at the OS level, is only supported on Windows. While trying to use it on Unix-like platforms does report an error, the error mes...
X Description: Using New-PSDrive -Persist, i.e. creating a persistent drive mapping at the OS level, is only supported on Windows. While trying to use it on Unix-like platforms does report an error, the error mes...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/8250
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"New-PSDrive -Persist should report a platform-not-supported error (System.PlatformNotSupportedException) on Unix-like platforms","articleBody":"Using `New-PSDrive -Persist`, i.e. creating a persistent drive mapping at the OS level, is only supported on Windows.\r\n\r\nWhile trying to use it on Unix-like platforms does report an error, the error message is confusing (see below).\r\n\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\nNew-PSDrive -root '\\\\foo\\bar\\' -name N -PSProvider filesystem -Persist\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\nThe error message should indicate that the host platform is not supported, along the lines of `System.PlatformNotSupportedException`\r\n\r\nActual behavior\r\n---------------\r\n\r\nThe following error is reported:\r\n\r\n```none\r\nNew-PSDrive : When you use the Persist parameter,\r\n the root must be a file system location on a remote computer.\r\n```\r\n\r\nThe reason is that the code currently blindly follows a Windows code path until it eventually hits the `PathIsNetworkPath()` method in `FileSystemProvider.cs`, which categorically returns `false` on Unix.\r\n\r\nEnvironment data\r\n----------------\r\n\r\n\u003c!-- provide the output of $PSVersionTable --\u003e\r\n\r\n```powershell\r\nPowerShell Core 6.2.0-preview.1 on macOS 10.14\r\nPowerShell Core 6.2.0-preview.1 on Ubuntu 16.04.5 LTS\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2018-11-13T16:24:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/8250/PowerShell/issues/8250"}
| 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:fe15b907-1ad7-851b-62ac-1271820ad6a4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B036:1580BD:1FF071C:2D7E32F:6A58EFF9 |
| html-safe-nonce | 8bed716f4bbd77f23fb2e37cb74f2de63bcce05f7c1fafce6975a040b3dcda69 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDM2OjE1ODBCRDoxRkYwNzFDOjJEN0UzMkY6NkE1OEVGRjkiLCJ2aXNpdG9yX2lkIjoiODMyNDcwNjQxMzIwMjQzNjA5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a4082588246dc73ca000620cb74a688e8af90e46248d66a92b05885d1615e934 |
| hovercard-subject-tag | issue:380310029 |
| 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/8250/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7cae49cd1f097bf72a353d2276e37e75cf92c53b7811214495c973df2e4ad59c/PowerShell/PowerShell/issues/8250 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7cae49cd1f097bf72a353d2276e37e75cf92c53b7811214495c973df2e4ad59c/PowerShell/PowerShell/issues/8250 |
| og:image:alt | Using New-PSDrive -Persist, i.e. creating a persistent drive mapping at the OS level, is only supported on Windows. While trying to use it on Unix-like platforms does report an error, the error mes... |
| 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 | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| 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 | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width