Title: Cmdlets may ignore parameter aliases in case of naming collisions with other parameters; e.g., "Get-ChildItem -d" · Issue #4739 · PowerShell/PowerShell · GitHub
Open Graph Title: Cmdlets may ignore parameter aliases in case of naming collisions with other parameters; e.g., "Get-ChildItem -d" · Issue #4739 · PowerShell/PowerShell
X Title: Cmdlets may ignore parameter aliases in case of naming collisions with other parameters; e.g., "Get-ChildItem -d" · Issue #4739 · PowerShell/PowerShell
Description: A parameter alias is designed to give an unambiguous alternative name - typically shorter than the original name - to a parameter. For instance, Get-ChildItem's -Directory parameter (switch) has two aliases: -ad and -d. Thus, both Get-Ch...
Open Graph Description: A parameter alias is designed to give an unambiguous alternative name - typically shorter than the original name - to a parameter. For instance, Get-ChildItem's -Directory parameter (switch) has tw...
X Description: A parameter alias is designed to give an unambiguous alternative name - typically shorter than the original name - to a parameter. For instance, Get-ChildItem's -Directory parameter (switch) ha...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/4739
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cmdlets may ignore parameter aliases in case of naming collisions with other parameters; e.g., \"Get-ChildItem -d\"","articleBody":"A parameter alias is designed to give an _unambiguous_ alternative name - typically shorter than the original name - to a parameter.\r\n\r\nFor instance, `Get-ChildItem`'s `-Directory` parameter (switch) has two aliases: `-ad` and `-d`.\r\n\r\nThus, both `Get-ChildItem -ad` and `Get-ChildItem -d` should work the same as `Get-ChildItem -Directory`.\r\n\r\nHowever, `Get-ChildItem -d` is currently misinterpreted as the `-Depth` parameter.\r\n\r\nThe same problem _may_ affect other cmdlets analogously.\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\nGet-ChildItem -ad\r\nGet-ChildItem -d\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\nBoth commands should list the subdirectories of the current directory.\r\n\r\nActual behavior\r\n---------------\r\n\r\n`Get-ChildItem -ad` succeeds, but `Get-ChildItem -d` fails with the following error:\r\n\r\n```none\r\nGet-ChildItem : Missing an argument for parameter 'Depth'. Specify a parameter of type 'System.UInt32' and try again.\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```powershell\r\nPowerShell Core v6.0.0-beta.6 on macOS 10.12.6\r\nPowerShell Core v6.0.0-beta.6 on Ubuntu 16.04.3 LTS\r\nPowerShell Core v6.0.0-beta.6 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)\r\nWindows PowerShell v5.1.15063.502 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2017-09-01T22:31:35Z","url":"https://github.com/PowerShell/PowerShell/issues/4739"}
| 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:4a8c7065-c474-53d4-ce2e-9e66c0bfaead |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A198:2A37BB:7231A4:A08AD3:6AFDC292 |
| html-safe-nonce | e1d1417a91eb9655fc8d0187cdd05955785d3fe0ae6768466afdb749cd47ee04 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTk4OjJBMzdCQjo3MjMxQTQ6QTA4QUQzOjZBRkRDMjkyIiwidmlzaXRvcl9pZCI6Ijc1ODgyODY1MzYwNDc1MTAxNjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 750a1fff6844b3a6a9bd003b4f33350a7038ac36165d88fa20cdc664ec0ef929 |
| hovercard-subject-tag | issue:254765309 |
| 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/4739/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fbb0ad0ff52551dfcfcbc37eb470961d1e4d3292a5758a10b10508948e358b86/PowerShell/PowerShell/issues/4739 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fbb0ad0ff52551dfcfcbc37eb470961d1e4d3292a5758a10b10508948e358b86/PowerShell/PowerShell/issues/4739 |
| og:image:alt | A parameter alias is designed to give an unambiguous alternative name - typically shorter than the original name - to a parameter. For instance, Get-ChildItem's -Directory parameter (switch) has tw... |
| 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 | 35c6bf57da1370dc64866160540c0ee9f825f291935b3bf6ec5492b00e35f3a6 |
| 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 | ab48c73a2978548773f5f24717ed9e58508befdb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width