Title: Using a dynamicparam block in an advanced function causes invocations with the -PipelineVariable common parameter to fail · Issue #6420 · PowerShell/PowerShell · GitHub
Open Graph Title: Using a dynamicparam block in an advanced function causes invocations with the -PipelineVariable common parameter to fail · Issue #6420 · PowerShell/PowerShell
X Title: Using a dynamicparam block in an advanced function causes invocations with the -PipelineVariable common parameter to fail · Issue #6420 · PowerShell/PowerShell
Description: An (adapted) copy of this uservoice issue first reported by @PetSerAl in 2014: Using a dynamicparam block in an advanced function causes invocations with the -PipelineVariable common parameter to fail. Steps to reproduce function foo { [...
Open Graph Description: An (adapted) copy of this uservoice issue first reported by @PetSerAl in 2014: Using a dynamicparam block in an advanced function causes invocations with the -PipelineVariable common parameter to f...
X Description: An (adapted) copy of this uservoice issue first reported by @PetSerAl in 2014: Using a dynamicparam block in an advanced function causes invocations with the -PipelineVariable common parameter to f...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/6420
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Using a dynamicparam block in an advanced function causes invocations with the -PipelineVariable common parameter to fail","articleBody":"An (adapted) copy of [this uservoice issue](https://windowsserver.uservoice.com/forums/301869/suggestions/11088336) first reported by @PetSerAl in 2014:\r\n\r\nUsing a `dynamicparam` block in an advanced function causes invocations with the `-PipelineVariable` common parameter to fail.\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\n\r\nfunction foo {\r\n [CmdletBinding()]\r\n param()\r\n dynamicparam { }\r\n process { 'hi' }\r\n}\r\n\r\nfoo -PipelineVariable bar\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n```none\r\nhi\r\n```\r\n\r\nActual behavior\r\n---------------\r\n\r\nThe following error is reported:\r\n\r\n```none\r\nfoo : Cannot retrieve the dynamic parameters for the cmdlet. Object reference not set to an instance of an object.\r\n...\r\n```\r\n\r\nNote that it doesn't make a difference whether the `dynamicparam` block is empty or not.\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```powershell\r\nPowerShell Core v6.0.2 on macOS 10.13.3\r\nPowerShell Core v6.0.2 on Ubuntu 16.04.3 LTS\r\nPowerShell Core v6.0.2 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)\r\nWindows PowerShell v5.1.15063.674 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":"2018-03-17T18:44:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/6420/PowerShell/issues/6420"}
| 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:5225f1ee-dfb9-2d67-2cd4-91a9da022361 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D38A:6464A:298879F:3B72E30:6A58FEC1 |
| html-safe-nonce | 5a27df71cd68c253c05e6f82ece3c7ef23937e20e7a72c013bd78ff610aa55fb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzhBOjY0NjRBOjI5ODg3OUY6M0I3MkUzMDo2QTU4RkVDMSIsInZpc2l0b3JfaWQiOiI3NTY4Nzk3NDMwNDQxMzc3NDczIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b8a3493eaa1cb86144d2f2e2d414a3c2718d20c600c4f335e62afec6cc6c8225 |
| hovercard-subject-tag | issue:306180315 |
| 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/6420/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4740d822192d42894bce12b8957aee5793aadbd5c7ec8352ba831ab9771516fb/PowerShell/PowerShell/issues/6420 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4740d822192d42894bce12b8957aee5793aadbd5c7ec8352ba831ab9771516fb/PowerShell/PowerShell/issues/6420 |
| og:image:alt | An (adapted) copy of this uservoice issue first reported by @PetSerAl in 2014: Using a dynamicparam block in an advanced function causes invocations with the -PipelineVariable common parameter to f... |
| 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 | 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 | 9842457e8d7e3b2e1635a63af28da35614845510 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width