Title: CommandInvocationIntrinsics.InvokeScript bind arguments to $input instead of $args · Issue #4923 · PowerShell/PowerShell · GitHub
Open Graph Title: CommandInvocationIntrinsics.InvokeScript bind arguments to $input instead of $args · Issue #4923 · PowerShell/PowerShell
X Title: CommandInvocationIntrinsics.InvokeScript bind arguments to $input instead of $args · Issue #4923 · PowerShell/PowerShell
Description: This lines: public Collection
Open Graph Description: This lines: public Collection
X Description: This lines: public Collection<PSObject> InvokeScript(string script, params object[] args) { return InvokeScript(script, true, PipelineResultTypes.None, args); } Pass args parameter into input...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/4923
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CommandInvocationIntrinsics.InvokeScript bind arguments to $input instead of $args","articleBody":"[This lines](https://github.com/PowerShell/PowerShell/blob/master@%7B2017-09-26%7D/src/System.Management.Automation/engine/MshCmdlet.cs#L687-L690):\r\n```csharp\r\npublic Collection\u003cPSObject\u003e InvokeScript(string script, params object[] args)\r\n{\r\n return InvokeScript(script, true, PipelineResultTypes.None, args);\r\n}\r\n``` \r\nPass `args` parameter into `input` parameter of called function, thus mixing them up.\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\n$ExecutionContext.SessionState.InvokeCommand.InvokeScript('\"`$args:($args); `$input:($input)\"', 1, 2, 3)\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n```none\r\n$args:(1 2 3); $input:()\r\n```\r\n\r\nActual behavior\r\n---------------\r\n\r\n```none\r\n$args:(); $input:(1 2 3)\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\nTested in v2.0 and v5.1.15063.608","author":{"url":"https://github.com/PetSerAl","@type":"Person","name":"PetSerAl"},"datePublished":"2017-09-26T16:49:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/4923/PowerShell/issues/4923"}
| 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:6651810e-f190-52c9-c17d-4f6b69305dd8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC0C:A2EB1:3E2242:55F34B:6A584C5A |
| html-safe-nonce | 3403c11b0714defe2be6010154445b7465f53b1014613d31a9bbc32416985f4a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzBDOkEyRUIxOjNFMjI0Mjo1NUYzNEI6NkE1ODRDNUEiLCJ2aXNpdG9yX2lkIjoiNzgxMjUwMTgyOTA5NTgwMzk5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fea9fd80eea1a587b0b2aa917582b1d386af49c8d37d499d1eda1a0df49dab72 |
| hovercard-subject-tag | issue:260694794 |
| 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/4923/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e714e49fd6eb106df7c8a62426a6795bc245d2250959bb051e0b7817f9da277e/PowerShell/PowerShell/issues/4923 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e714e49fd6eb106df7c8a62426a6795bc245d2250959bb051e0b7817f9da277e/PowerShell/PowerShell/issues/4923 |
| og:image:alt | This lines: public Collection |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | PetSerAl |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| 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 | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width