Title: On Unix, PowerShell will not find files with backslashes in their names · Issue #3666 · PowerShell/PowerShell · GitHub
Open Graph Title: On Unix, PowerShell will not find files with backslashes in their names · Issue #3666 · PowerShell/PowerShell
X Title: On Unix, PowerShell will not find files with backslashes in their names · Issue #3666 · PowerShell/PowerShell
Description: This is similar to #3414, but involves only the backslash portion. The basis of the problem is premature normalization of paths. Path normalization happens quite early (and very frequently and in a great number of places in the PowerShel...
Open Graph Description: This is similar to #3414, but involves only the backslash portion. The basis of the problem is premature normalization of paths. Path normalization happens quite early (and very frequently and in a...
X Description: This is similar to #3414, but involves only the backslash portion. The basis of the problem is premature normalization of paths. Path normalization happens quite early (and very frequently and in a...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/3666
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"On Unix, PowerShell will not find files with backslashes in their names","articleBody":"This is similar to #3414, but involves only the backslash portion.\r\n\r\nThe basis of the problem is premature normalization of paths. Path normalization happens quite early (and *very* frequently and in a great number of places in the PowerShell code) while processing a command. Usually this happens before the path reaches its provider, and often that normalization is a brute-force change one slash to another mechanism. Thus a path such as `1\\2` on Unix is \"normalized\" to `1/2`, ensuring that the path will never be found.\r\n\r\nUsing `-LiteralPath` does not prevent the path normalization, so that is not a workaround.\r\n\r\nSteps to reproduce\r\n------------------\r\nFrom bash:\r\n```bash\r\n$ touch 'a\\b'\r\n```\r\nthen from PowerShell:\r\n```PowerShell\r\nPS> Remove-Item a\\b\r\n```\r\nor\r\n```PowerShell\r\nPS> Move-Item a\\b a-b\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\nThe file `a\\b` is deleted\r\n\r\nActual behavior\r\n---------------\r\n```\r\nRemove-Item : Cannot find path 'a/b' because it does not exist.\r\nAt line:1 char:1\r\n+ Remove-Item a\\b\r\n+ ~~~~~~~~~~~~~~~\r\n + CategoryInfo : ObjectNotFound: (a/b:String) \r\n [Remove-Item], ItemNotFoundException\r\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```powershell\r\n> $PSVersionTable\r\nName Value \r\n---- ----- \r\nBuildVersion 3.0.0.0 \r\nCLRVersion \r\nGitCommitId v6.0.0-alpha.18-38-g08e855556cff42274a5903799b826e78d0c...\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} \r\nPSEdition Core \r\nPSRemotingProtocolVersion 2.3 \r\nPSVersion 6.0.0-alpha \r\nSerializationVersion 1.1.0.1 \r\nWSManStackVersion 3.0 \r\n```\r\n","author":{"url":"https://github.com/jeffbi","@type":"Person","name":"jeffbi"},"datePublished":"2017-05-01T00:30:26Z","url":"https://github.com/PowerShell/PowerShell/issues/3666"}
| 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:140c9738-834f-22e2-37ee-465123c1b183 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA9C:24835A:284FAE:390ADD:6AFD74B6 |
| html-safe-nonce | 2fe7faf566a41dfb34c37f5055a2a4014a4a01a913e22d6cfd52d5fc0d88f734 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTlDOjI0ODM1QToyODRGQUU6MzkwQUREOjZBRkQ3NEI2IiwidmlzaXRvcl9pZCI6IjgyODM1NTkxNDkwNDg3ODgxNTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 12dfb88e792319e714eea8c3a49fb96728811304580dbf8f7fb45d66051c3f09 |
| hovercard-subject-tag | issue:225366002 |
| 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/3666/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aca442c599e8c68e5695cb9cf04eda4deac88988ea513c3026d72f6d12391d14/PowerShell/PowerShell/issues/3666 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aca442c599e8c68e5695cb9cf04eda4deac88988ea513c3026d72f6d12391d14/PowerShell/PowerShell/issues/3666 |
| og:image:alt | This is similar to #3414, but involves only the backslash portion. The basis of the problem is premature normalization of paths. Path normalization happens quite early (and very frequently and in a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jeffbi |
| hostname | github.com |
| expected-hostname | github.com |
| None | e54006cf2b96d1ac260960edd10003132911469ccd1ec99c9803119fe2a4e032 |
| 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 | 5be0bf2b8cf26f8897d31e6bc3c232d328b12a54 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width