Title: [System.Management.Automation.ProviderInfo] (returned by Get-PSProvider) should contain path-separator information · Issue #5544 · PowerShell/PowerShell · GitHub
Open Graph Title: [System.Management.Automation.ProviderInfo] (returned by Get-PSProvider) should contain path-separator information · Issue #5544 · PowerShell/PowerShell
X Title: [System.Management.Automation.ProviderInfo] (returned by Get-PSProvider) should contain path-separator information · Issue #5544 · PowerShell/PowerShell
Description: Currently, there is no way to learn of the path-separator character(s) that must be used to separate the components of a path for a given provider, because [System.Management.Automation.ProviderInfo], as returned by Get-PSProvider, has n...
Open Graph Description: Currently, there is no way to learn of the path-separator character(s) that must be used to separate the components of a path for a given provider, because [System.Management.Automation.ProviderInf...
X Description: Currently, there is no way to learn of the path-separator character(s) that must be used to separate the components of a path for a given provider, because [System.Management.Automation.ProviderInf...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/5544
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[System.Management.Automation.ProviderInfo] (returned by Get-PSProvider) should contain path-separator information","articleBody":"Currently, there is no way to learn of the path-separator character(s) that must be used to separate the components of a path for a given provider, because `[System.Management.Automation.ProviderInfo]`, as returned by `Get-PSProvider`, has no such property.\r\n\r\nIn the absence of such information, users may be tempted to assume that `\\` and `/` can be universally - and interchangeably - used, which is _not necessarily_ true; for instance, the registry provider only properly supports `\\`, given that `/` is a valid char. in registry key names - see #5536\r\n\r\nFuture providers - or even existing third-party providers - could conceivably use completely different characters (of necessity).\r\n\r\nAdding a `[string[]]`-typed `.PathSeparator` property to `[System.Management.Automation.ProviderInfo]` would help.\r\n\r\nAdditional considerations:\r\n\r\n* Non-hierarchical providers such as the `Variable` and `Function` providers have no real need for a path separator: e.g., `Get-Item variable:PSHome` works just fine. In practice, these providers follow the `FileSystem` provider's example and allow interchangeable use of `/` and `\\`, and tab completion even explicitly inserts these optional chars.: `/` on Unix, and `\\` on Windows.\r\n\r\n* Third-party implementers of providers will need to provide appropriate values for `.PathSeparator` too.\r\n\r\n* The name to give this new property is debatable, given that the .NET framework has already sown confusion around `[System.IO.Path]::DirectorySeparator` (the path-_component_ separator) vs. `[System.IO.Path]::PathSeparator` (the path-_environment-variable-entry_ separator). However, given that the term _directory_ is filesystem-specific and we're talking about abstractions here, my vote is still for `.PathSeparator`.\r\n\r\nDesired behavior\r\n------------------\r\n\r\n```powershell\r\n> Get-PSProvider FileSystem | % PathSeparator\r\n\\\r\n/\r\n\r\n> Get-PSProvider Registry | % PathSeparator\r\n\\\r\n```\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-rc\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2017-11-25T13:49:38Z","url":"https://github.com/PowerShell/PowerShell/issues/5544"}
| 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:3cebc276-7927-757a-2605-d9fc5b21a2f0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CE64:5A274:2B100:3C401:6AFD68B2 |
| html-safe-nonce | ae55b95f0de7c3d268a5f5d94072f11432e0607b2e8c6cb74c7071a39b72eb7c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRTY0OjVBMjc0OjJCMTAwOjNDNDAxOjZBRkQ2OEIyIiwidmlzaXRvcl9pZCI6IjU1NDAyMTMxMDE1NjkwNzUzNzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 60aeca0a1ccb37f7b492e1a9276d979d2fa1c35495ab53e753b765320c37712d |
| hovercard-subject-tag | issue:276751919 |
| 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/5544/issue_layout |
| twitter:image | https://opengraph.githubassets.com/50d8b3b81749a825be60d0840fddc1c6cf8ead59d244f01e33db29cde1aed4df/PowerShell/PowerShell/issues/5544 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/50d8b3b81749a825be60d0840fddc1c6cf8ead59d244f01e33db29cde1aed4df/PowerShell/PowerShell/issues/5544 |
| og:image:alt | Currently, there is no way to learn of the path-separator character(s) that must be used to separate the components of a path for a given provider, because [System.Management.Automation.ProviderInf... |
| 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 | 9985ca2e21b59673104d4d830d4afeb946c67f248f273ab2e824c31c8db46e4a |
| 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 | 0db9e8d463c3f4540570e6ad3c501a06db9dc02a |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width