Title: On Windows and macOS, Get-Item and Get-ChildItem report file names as specified, not their actual case · Issue #13190 · PowerShell/PowerShell · GitHub
Open Graph Title: On Windows and macOS, Get-Item and Get-ChildItem report file names as specified, not their actual case · Issue #13190 · PowerShell/PowerShell
X Title: On Windows and macOS, Get-Item and Get-ChildItem report file names as specified, not their actual case · Issue #13190 · PowerShell/PowerShell
Description: Note: The problem: affects only files, not also directories for file paths, affects all path components. Simple demonstration (macOS and Windows): PS> (Get-Item $PSHOME/POWERSHELL.config.json).Name POWERSHELL.config.json Note how POWERSH...
Open Graph Description: Note: The problem: affects only files, not also directories for file paths, affects all path components. Simple demonstration (macOS and Windows): PS> (Get-Item $PSHOME/POWERSHELL.config.json).Name...
X Description: Note: The problem: affects only files, not also directories for file paths, affects all path components. Simple demonstration (macOS and Windows): PS> (Get-Item $PSHOME/POWERSHELL.config.json).N...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/13190
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"On Windows and macOS, Get-Item and Get-ChildItem report file names as specified, not their actual case","articleBody":"Note: The problem:\r\n\r\n* affects only _files_, not also directories\r\n\r\n* for file _paths_, affects all path components.\r\n\r\nSimple demonstration (macOS and Windows):\r\n\r\n```powershell\r\nPS\u003e (Get-Item $PSHOME/POWERSHELL.config.json).Name\r\nPOWERSHELL.config.json\r\n```\r\n\r\nNote how `POWERSHELL.config.json` was reported via `.Name` - exactly as specified - even though the actual casing of the filename is `powershell.config.json`\r\n\r\n## Steps to reproduce\r\n\r\nWindows and macOS only (platforms with case-insensitive (but case-preserving) file-systems).\r\n\r\n```powershell\r\n# Note: The problem occurs only with *files*, not directories.\r\n# With files, the problem occurs in all path components.\r\nDescribe \"Get-Item / Get-ChildItem: non-wildcard file-name case fidelity test\" {\r\n BeforeAll {\r\n Push-Location (Get-Item testdrive:/).FullName\r\n $nameActual = 'AB'\r\n $nameCaseVariant = 'aB'\r\n New-Item $nameActual # create as all-uppercase\r\n\r\n $testCases = \r\n @{ Cmdlet = 'Get-Item'; Parameter = 'Path'; Property = 'Name' },\r\n @{ Cmdlet = 'Get-Item'; Parameter = 'Path'; Property = 'FullName' },\r\n @{ Cmdlet = 'Get-Item'; Parameter = 'LiteralPath'; Property = 'Name' },\r\n @{ Cmdlet = 'Get-Item'; Parameter = 'LiteralPath'; Property = 'FullName' },\r\n @{ Cmdlet = 'Get-ChildItem'; Parameter = 'Path'; Property = 'Name' },\r\n @{ Cmdlet = 'Get-ChildItem'; Parameter = 'Path'; Property = 'FullName' },\r\n @{ Cmdlet = 'Get-ChildItem'; Parameter = 'LiteralPath'; Property = 'Name' },\r\n @{ Cmdlet = 'Get-ChildItem'; Parameter = 'LiteralPath'; Property = 'FullName' }\r\n }\r\n \r\n It \"\u003cCmdlet\u003e: .\u003cProperty\u003e should report '$nameActual' as the file name when literal case variant '$nameCaseVariant' is passed to \u003cParameter\u003e\" -Skip:$IsLinux -TestCase $testCases {\r\n param($Cmdlet, $Parameter, $Property) \r\n $htArgs = @{ $Parameter = $nameCaseVariant }\r\n Split-Path -Leaf (\u0026 $Cmdlet @htArgs).$Property | Should -BeExactly $nameActual\r\n }\r\n AfterAll {\r\n Pop-Location\r\n }\r\n}\r\n```\r\n\r\n## Expected behavior\r\n\r\nThe tests should succeed.\r\n\r\n## Actual behavior\r\n\r\nAll tests fail.\r\n\r\n## Environment data\r\n\r\n\r\n```none\r\nPowerShell Core 7.1.0-preview.5\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2020-07-16T09:47:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":43},"url":"https://github.com/13190/PowerShell/issues/13190"}
| 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:fd8212c6-d17a-017b-fbc1-eb989ee3071a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C930:2D3361:41B6A1D:5D12C00:6A56DFE5 |
| html-safe-nonce | d37e36eb1c78c8ae126bd1f7b5641ac46a0e42fb6a9988d4dc3bd915e2d619ea |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTMwOjJEMzM2MTo0MUI2QTFEOjVEMTJDMDA6NkE1NkRGRTUiLCJ2aXNpdG9yX2lkIjoiMTc3ODkxMTM2NjI4NTI4NzM5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3728e9751d56e6f27d9a31f5b8f62371bb1218204a985888f5538772456f167c |
| hovercard-subject-tag | issue:658037781 |
| 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/13190/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6026294032a11dfcefe857be38d733e42ced28cfc3106bd62aa9fed1f15c328a/PowerShell/PowerShell/issues/13190 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6026294032a11dfcefe857be38d733e42ced28cfc3106bd62aa9fed1f15c328a/PowerShell/PowerShell/issues/13190 |
| og:image:alt | Note: The problem: affects only files, not also directories for file paths, affects all path components. Simple demonstration (macOS and Windows): PS> (Get-Item $PSHOME/POWERSHELL.config.json).Name... |
| 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 | 5220a278731283038daf0ed00b41f06ef7ff9539020ecc806c5c5a0fb6bda25a |
| 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 | 8684ae1a81cd3e4ef219b241179982bbda1a5b1f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width