Title: CLI: Ambiguous parameter names such as -no are misinterpreted as positional parameter values · Issue #4351 · PowerShell/PowerShell · GitHub
Open Graph Title: CLI: Ambiguous parameter names such as -no are misinterpreted as positional parameter values · Issue #4351 · PowerShell/PowerShell
X Title: CLI: Ambiguous parameter names such as -no are misinterpreted as positional parameter values · Issue #4351 · PowerShell/PowerShell
Description: Steps to reproduce # -no is ambiguous: could be -NoProfile, -NoLogo, ... powershell -no -command get-date Expected behavior An error complaining about the ambiguity of the parameter name and refusal to continue. Actual behavior PS Core a...
Open Graph Description: Steps to reproduce # -no is ambiguous: could be -NoProfile, -NoLogo, ... powershell -no -command get-date Expected behavior An error complaining about the ambiguity of the parameter name and refusa...
X Description: Steps to reproduce # -no is ambiguous: could be -NoProfile, -NoLogo, ... powershell -no -command get-date Expected behavior An error complaining about the ambiguity of the parameter name and refusa...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/4351
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CLI: Ambiguous parameter names such as -no are misinterpreted as positional parameter values","articleBody":"Steps to reproduce\r\n------------------\r\n\r\n```powershell\r\n# -no is ambiguous: could be -NoProfile, -NoLogo, ...\r\npowershell -no -command get-date\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\nAn error complaining about the ambiguity of the parameter name and refusal to continue.\r\n\r\nActual behavior\r\n---------------\r\n\r\nPS Core and Windows PS behave differently, due to the recent Core change to default to `-File` instead of `-Command`:\r\n\r\n* PowerShell Core:\r\n\r\n```none\r\nThe argument '-no' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter.\r\nPowerShell v6.0.0-beta.4\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n```\r\n\r\n* Windows PowerShell:\r\n\r\n```none\r\n-no : The term '-no' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was\r\nincluded, verify that the path is correct and try again.\r\nAt line:1 char:1\r\n+ -no -command get-date\r\n+ ~~~\r\n + CategoryInfo : ObjectNotFound: (-no:String) [], CommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```powershell\r\nPowerShell Core v6.0.0-beta.4 on macOS 10.12.5\r\nPowerShell Core v6.0.0-beta.4 on Ubuntu 16.04.2 LTS\r\nPowerShell Core v6.0.0-beta.4 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)\r\nWindows PowerShell v5.1.15063.413 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-07-26T20:38:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/4351/PowerShell/issues/4351"}
| 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:c11a758a-e4ca-0a27-67e8-256c0a3edb94 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 965E:3DEC57:5765FCB:7B0A21A:6A572C70 |
| html-safe-nonce | 08d170914ba60963afd2f55d0f9349a63658d6744e03fb0503dd74bcddda5e0f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjVFOjNERUM1Nzo1NzY1RkNCOjdCMEEyMUE6NkE1NzJDNzAiLCJ2aXNpdG9yX2lkIjoiNDkxNDM1NjAyMDU3Nzc3NDcwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 11ea030f083ebf537192f6e39d1022d64714e2f1fe4eb5a279b7aebc57725fec |
| hovercard-subject-tag | issue:245847174 |
| 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/4351/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c9f1cf102cc8f2df03e21533ad55d3dc4912f4da3f44f451f7a0acc22b405938/PowerShell/PowerShell/issues/4351 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c9f1cf102cc8f2df03e21533ad55d3dc4912f4da3f44f451f7a0acc22b405938/PowerShell/PowerShell/issues/4351 |
| og:image:alt | Steps to reproduce # -no is ambiguous: could be -NoProfile, -NoLogo, ... powershell -no -command get-date Expected behavior An error complaining about the ambiguity of the parameter name and refusa... |
| 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 | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| 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 | 2576d1f0198cf1588faf2edf27f1ed120903be10 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width