Title: PowerShell can't handle empty commandline parameter · Issue #10975 · PowerShell/PowerShell · GitHub
Open Graph Title: PowerShell can't handle empty commandline parameter · Issue #10975 · PowerShell/PowerShell
X Title: PowerShell can't handle empty commandline parameter · Issue #10975 · PowerShell/PowerShell
Description: Steps to reproduce pwsh-preview '' pwsh-preview -c '' pwsh-preview -c ' ' # or in pwsh: pwsh-preview ' ' Expected behavior '' or ' ' should be parsed correctly. Actual behavior Unhandled exception. System.ArgumentNullException: Value can...
Open Graph Description: Steps to reproduce pwsh-preview '' pwsh-preview -c '' pwsh-preview -c ' ' # or in pwsh: pwsh-preview ' ' Expected behavior '' or ' ' should be parsed correctly. Actual behavior Unhandled exception....
X Description: Steps to reproduce pwsh-preview '' pwsh-preview -c '' pwsh-preview -c ' ' # or in pwsh: pwsh-preview ' ' Expected behavior '' or ' ' should be parsed...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/10975
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PowerShell can't handle empty commandline parameter","articleBody":"\u003c!--\r\n\r\nFor Windows PowerShell 5.1 issues, suggestions, or feature requests please use the following link instead:\r\nWindows PowerShell [UserVoice](https://windowsserver.uservoice.com/forums/301869-powershell)\r\n\r\nThis repository is **ONLY** for PowerShell Core 6 issues.\r\n\r\n- Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- Search the existing issues.\r\n- Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- Refer to the [known issues](https://docs.microsoft.com/powershell/scripting/whats-new/known-issues-ps6?view=powershell-6).\r\n\r\n-->\r\n\r\n# Steps to reproduce\r\n\r\n```bash\r\npwsh-preview ''\r\npwsh-preview -c ''\r\npwsh-preview -c ' '\r\n# or in pwsh: pwsh-preview ' '\r\n```\r\n\r\n# Expected behavior\r\n\r\n`''` or `' '` should be parsed correctly.\r\n\r\n# Actual behavior\r\n\r\n```none\r\nUnhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'value')\r\n at System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType)\r\n at System.String.IndexOf(String value, StringComparison comparisonType)\r\n at Microsoft.PowerShell.CommandLineParameterParser.MatchSwitch(String switchKey, String match, String smallestUnambiguousMatch)\r\n at Microsoft.PowerShell.CommandLineParameterParser.EarlyParse(String[] args)\r\n at Microsoft.PowerShell.UnmanagedPSEntry.Start(String consoleFilePath, String[] args, Int32 argc)\r\n at Microsoft.PowerShell.ManagedPSEntry.Main(String[] args)\r\n```\r\nIf run it in bash/zsh, I will also get a core dump.\r\n\r\n# Environment data\r\n\r\n\u003c!-- provide the output of $PSVersionTable -->\r\n\r\n```none\r\nName Value\r\n---- -----\r\nPSVersion 7.0.0-preview.5\r\nPSEdition Core\r\nGitCommitId 7.0.0-preview.5\r\nOS Linux 5.3.7-zen1-2-zen #1 ZEN SMP PREEMPT @1572002936\r\nPlatform Unix\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","author":{"url":"https://github.com/Aloxaf","@type":"Person","name":"Aloxaf"},"datePublished":"2019-11-02T04:08:33Z","url":"https://github.com/PowerShell/PowerShell/issues/10975"}
| 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:a1f2761d-ef44-e25e-973d-3c7d9168e731 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C4BC:C35DD:2642DA8:353BA51:6AFD448D |
| html-safe-nonce | b0ca9a495850e360dcc61d978b65154758c0d4e3d3177f5f985483025faf1f29 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNEJDOkMzNUREOjI2NDJEQTg6MzUzQkE1MTo2QUZENDQ4RCIsInZpc2l0b3JfaWQiOiI1NDc4NzgxNzcyMDE3NTE3NzA5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 474fea9fc7140745f857ab1a8c2ec62e078fcb7bc38944ed49da458f95d75d96 |
| hovercard-subject-tag | issue:516463453 |
| 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/10975/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f012a1fcaf1de79f9d369e9e3831776fb7e356ec9c4c49441e39254caea56219/PowerShell/PowerShell/issues/10975 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f012a1fcaf1de79f9d369e9e3831776fb7e356ec9c4c49441e39254caea56219/PowerShell/PowerShell/issues/10975 |
| og:image:alt | Steps to reproduce pwsh-preview '' pwsh-preview -c '' pwsh-preview -c ' ' # or in pwsh: pwsh-preview ' ' Expected behavior '' or ' ' should be parsed correctly. Actual behavior Unhandled exception.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Aloxaf |
| hostname | github.com |
| expected-hostname | github.com |
| None | bdbacc25b921224ff0befcb9e629560a1255be51aec9991d6e3f95b5e9151474 |
| 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 | 556dd37bb0aceffb25724e151b5d858b3265b40b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width