Title: Parameter values disambiguated with their explicit parameter names should not require quoting · Issue #4576 · PowerShell/PowerShell · GitHub
Open Graph Title: Parameter values disambiguated with their explicit parameter names should not require quoting · Issue #4576 · PowerShell/PowerShell
X Title: Parameter values disambiguated with their explicit parameter names should not require quoting · Issue #4576 · PowerShell/PowerShell
Description: In order to pass a parameter value that looks like a parameter name you currently have to use quoting - sometimes. However, if you explicitly precede the value with its parameter name as opposed to passing it positionally, no quoting sho...
Open Graph Description: In order to pass a parameter value that looks like a parameter name you currently have to use quoting - sometimes. However, if you explicitly precede the value with its parameter name as opposed to...
X Description: In order to pass a parameter value that looks like a parameter name you currently have to use quoting - sometimes. However, if you explicitly precede the value with its parameter name as opposed to...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/4576
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Parameter values disambiguated with their explicit parameter names should not require quoting","articleBody":"In order to pass a parameter _value_ that _looks like_ a parameter _name_ you currently have to use _quoting_ - _sometimes_.\r\n\r\nHowever, if you explicitly precede the value with its parameter _name_ as opposed to passing it _positionally_, no quoting should be necessary.\r\n\r\nEspecially with respect to PowerShell's CLI and all its quoting headaches, this extra quoting requirement should be reconsidered - see #4351\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\n'hi'>'-t.txt'; Get-Content '-t.txt'; Get-Content -LiteralPath -t.txt\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n```none\r\nhi\r\nhi\r\n```\r\n\r\nThe two `Get-Content` commands should be equivalent: \r\n\r\n* In the 1st case, the quoting implies that `-t.txt` is a parameter _value_ rather than a _name_. \r\n* In the 2nd case, the explicit use of parameter `-LiteralPath`, which _requires_ a value, should unambiguously identify the _next_ token as the parameter _value_ - even if it starts with `-` - _whether quoted or not_.\r\n\r\nActual behavior\r\n---------------\r\n\r\n```none\r\nhi\r\nGet-Content : Parameter cannot be processed because the parameter name 't' is ambiguous. Possible matches include: -TotalCount -Tail.\r\n...\r\n```\r\n\r\nThat is, despite being preceded by `-LiteralPath`, which _requires_ a parameter value, \r\n _unquoted_ `-t.txt` was _not_ interpreted as that parameter's _value_, but as another parameter _name_.\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-beta.5 on macOS 10.12.6\r\nPowerShell Core v6.0.0-beta.5 on Ubuntu 16.04.3 LTS\r\nPowerShell Core v6.0.0-beta.5 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)\r\nWindows PowerShell v5.1.15063.483 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-08-15T01:22:34Z","url":"https://github.com/PowerShell/PowerShell/issues/4576"}
| 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:41693f4c-46d9-dfc9-1aaa-f800c53c9413 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 81C0:126CB9:2900550:393014A:6AFD5814 |
| html-safe-nonce | 5ebc4d23da5fb06b568a77e50da80ecd4738109ebddb25f3887f71034d968146 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUMwOjEyNkNCOToyOTAwNTUwOjM5MzAxNEE6NkFGRDU4MTQiLCJ2aXNpdG9yX2lkIjoiNjExNzY1MjEwOTk4MzU2OTk0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 99cb05004393890e5505844699e63904020fe8ac7683bb1ed6d4edcf76ef01a5 |
| hovercard-subject-tag | issue:250197048 |
| 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/4576/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a801259a417db9a796258e8e1dffbc213e7c97f877734697d7d56ff7ca2b6101/PowerShell/PowerShell/issues/4576 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a801259a417db9a796258e8e1dffbc213e7c97f877734697d7d56ff7ca2b6101/PowerShell/PowerShell/issues/4576 |
| og:image:alt | In order to pass a parameter value that looks like a parameter name you currently have to use quoting - sometimes. However, if you explicitly precede the value with its parameter name as opposed to... |
| 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 | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| 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 | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width