Title: Bug: can not handle "/" correctly when reading registry item · Issue #5536 · PowerShell/PowerShell · GitHub
Open Graph Title: Bug: can not handle "/" correctly when reading registry item · Issue #5536 · PowerShell/PowerShell
X Title: Bug: can not handle "/" correctly when reading registry item · Issue #5536 · PowerShell/PowerShell
Description: Steps to reproduce # ** careful "\" and "/" ** # initialization New-Item 'registry::HKEY_CURRENT_USER/test' New-ItemProperty 'registry::HKEY_CURRENT_USER\test' -Name test1 -Value test1 # read item. Get-Item 'registry::HKEY_CURRENT_USER/t...
Open Graph Description: Steps to reproduce # ** careful "\" and "/" ** # initialization New-Item 'registry::HKEY_CURRENT_USER/test' New-ItemProperty 'registry::HKEY_CURRENT_USER\test' -Name test1 -Value test1 # read item....
X Description: Steps to reproduce # ** careful "\" and "/" ** # initialization New-Item 'registry::HKEY_CURRENT_USER/test' New-ItemProperty 'registry::HKEY_CURRENT_USER\test' -...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/5536
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug: can not handle \"/\" correctly when reading registry item","articleBody":"Steps to reproduce\r\n------------------\r\n\r\n```powershell\r\n# ** careful \"\\\" and \"/\" **\r\n# initialization\r\nNew-Item 'registry::HKEY_CURRENT_USER/test'\r\nNew-ItemProperty 'registry::HKEY_CURRENT_USER\\test' -Name test1 -Value test1\r\n\r\n# read item.\r\nGet-Item 'registry::HKEY_CURRENT_USER/test'\r\nSet-ItemProperty 'registry::HKEY_CURRENT_USER/test' -Name test2 -Value abcde\r\n\r\n# read and create item\r\nCopy-Item 'registry::HKEY_CURRENT_USER/test' 'registry::HKEY_CURRENT_USER/test/t1'\r\nCopy-Item 'registry::HKEY_CURRENT_USER\\test' 'registry::HKEY_CURRENT_USER/test/t1'\r\n\r\n# clear\r\nRemove-Item 'registry::HKEY_CURRENT_USER\\test' -Recurse -Force\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n```none\r\nno errors\r\n```\r\n\r\nActual behavior\r\n---------------\r\n\r\n```none\r\nGet-Item : Cannot find path 'HKEY_CURRENT_USER/test' because it does not exist.\r\nAt line:1 char:1\r\n+ Get-Item 'registry::HKEY_CURRENT_USER/test'\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n+ CategoryInfo : ObjectNotFound: (HKEY_CURRENT_USER/test:String) [Get-Item], ItemNotFoundException\r\n+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand\r\n\r\nSet-ItemProperty : Cannot find path 'HKEY_CURRENT_USER/test' because it does not exist.\r\nAt line:1 char:1\r\n+ Set-ItemProperty 'registry::HKEY_CURRENT_USER/test' -Name test2 -Valu ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n+ CategoryInfo : ObjectNotFound: (HKEY_CURRENT_USER/test:String) [Set-ItemProperty], ItemNotFoundException\r\n+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand\r\n\r\nCopy-Item : Cannot find path 'HKEY_CURRENT_USER/test' because it does not exist.\r\nAt line:1 char:1\r\n+ Copy-Item 'registry::HKEY_CURRENT_USER/test' 'registry::HKEY_CURRENT_ ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n+ CategoryInfo : ObjectNotFound: (HKEY_CURRENT_USER/test:String) [Copy-Item], ItemNotFoundException\r\n+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n```powershell\r\n> $PSVersionTable\r\nName Value\r\n---- -----\r\nPSVersion 6.0.0-rc\r\nPSEdition Core\r\nGitCommitId v6.0.0-rc\r\nOS Microsoft Windows 10.0.16299\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\n## Summary\r\nafter trying, I found the law.\r\n1. can handle \"/\" correctly when creating item.\r\n2. can not handle \"/\" correctly when reading item.\r\n\r\nrelated cmdlets\r\n```powershell\r\nNew-Item\r\nNew-ItemPropert\r\nGet-ChildItem\r\nGet-Item\r\nGet-ItemProperty\r\nGet-ItemPropertyValue\r\nSet-Item\r\nSet-ItemProperty\r\nClear-Item\r\nClear-ItemProperty\r\nRemove-Item\r\nRemove-ItemProperty\r\nRename-Itemre\r\nRename-ItemProperty\r\nCopy-Item\r\nCopy-ItemProperty\r\nMove-Item\r\nMove-ItemProperty\r\n```","author":{"url":"https://github.com/ZSkycat","@type":"Person","name":"ZSkycat"},"datePublished":"2017-11-24T03:53:06Z","url":"https://github.com/PowerShell/PowerShell/issues/5536"}
| 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:072a2584-1a77-fd72-8e4c-c796f8ec1135 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E328:2401AE:285F7:38B31:6AFD6820 |
| html-safe-nonce | 8820cd1681e58b24ce2487bdafe27ac4f7e7a0e4277b9c4051f135003b9326e0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzI4OjI0MDFBRToyODVGNzozOEIzMTo2QUZENjgyMCIsInZpc2l0b3JfaWQiOiI1MTY3OTE5MDMxMzM5ODA0NzA0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6a09e8763b74e4630b6be2cdbc9e72a920619a182779eaf9fa7ff81b9366210e |
| hovercard-subject-tag | issue:276509004 |
| 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/5536/issue_layout |
| twitter:image | https://opengraph.githubassets.com/de478b0fa87114ed6581cd65056dd9c3bd9cc2d081df2964386be2c6d1214b92/PowerShell/PowerShell/issues/5536 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/de478b0fa87114ed6581cd65056dd9c3bd9cc2d081df2964386be2c6d1214b92/PowerShell/PowerShell/issues/5536 |
| og:image:alt | Steps to reproduce # ** careful "\" and "/" ** # initialization New-Item 'registry::HKEY_CURRENT_USER/test' New-ItemProperty 'registry::HKEY_CURRENT_USER\test' -Name test1 -Value test1 # read item.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ZSkycat |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42a67d7c7488271ca8d7e6dc3942424e6de3bff43b1ed4a9c6f0e1a69b73b389 |
| 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 | 5c3779ac05f3590d8d7ea0c02b14e678ae8179ae |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width