Title: Dynamic Parameters are too Difficult to Construct · Issue #20395 · PowerShell/PowerShell · GitHub
Open Graph Title: Dynamic Parameters are too Difficult to Construct · Issue #20395 · PowerShell/PowerShell
X Title: Dynamic Parameters are too Difficult to Construct · Issue #20395 · PowerShell/PowerShell
Description: Summary of the new feature / enhancement As a heavy user of dynamic parameters, I often find myself tripping over their basic failures in constructability. Dynamic Parameters are needlessly difficult to construct. The shortest possible c...
Open Graph Description: Summary of the new feature / enhancement As a heavy user of dynamic parameters, I often find myself tripping over their basic failures in constructability. Dynamic Parameters are needlessly difficu...
X Description: Summary of the new feature / enhancement As a heavy user of dynamic parameters, I often find myself tripping over their basic failures in constructability. Dynamic Parameters are needlessly difficu...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/20395
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dynamic Parameters are too Difficult to Construct","articleBody":"### Summary of the new feature / enhancement\r\n\r\nAs a heavy user of dynamic parameters, I often find myself tripping over their basic failures in constructability.\r\n\r\nDynamic Parameters are needlessly difficult to construct.\r\n\r\nThe shortest possible constructor is:\r\n\r\n~~~PowerShell\r\n[Management.Automation.RuntimeDefinedParameter]::new(\"A\", [psobject], @())\r\n~~~\r\n\r\nand it fails in an entreatingly confusing way, informing me that I could not bind \"A\" to \"AllParameterSets\", without telling me why.\r\n\r\nDynamic Parameters should be easier to construct.\r\n\r\nThe need goes beyond simplifying existing implementation and fixing its buggier parts:\r\n\r\nA very common scenario is exposing dynamic parameters from one command to another.\r\n\r\nThis should also be easier to construct\r\n\r\n### Proposed technical implementation details (optional)\r\n\r\n* [ ] Add simplified constructors to `[Management.Automation.RuntimeDefinedParameter]`\r\n * [ ] Constructing from only a name should create a `[PSObject]` parameter that accepts `ValueFromPipelineByPropertyName`\r\n * [ ] Constructing from a name and a type should add an empty `[Parameter()]` attribute\r\n* [ ] Allow `[Management.Automation.RuntimeDefinedParameter]` to be coerced from `[Management.Automation.ParameterMetadata]`\r\n* [ ] Create extension methods to assist in custom conversion to `[Management.Automation.RuntimeDefinedParameter]`\r\n* [ ] Enable adding dictionaries to `[Management.Automation.RuntimeDefinedParameterDictionary]`\r\n* [ ] Adding type accelerators `[DynamicParameter]`, `[DynamicParameters]`, so that less typing is required to create them.","author":{"url":"https://github.com/StartAutomating","@type":"Person","name":"StartAutomating"},"datePublished":"2023-09-28T21:58:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/20395/PowerShell/issues/20395"}
| 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:93222aec-0f69-5a8e-5c81-a0fe1f486851 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E63A:5C4F6:42430FE:5966F96:696E0423 |
| html-safe-nonce | 7e397286a3a6e3e952d5c2109c9d4ebfe44908318e1a9b488a136a3ecbfe714d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjNBOjVDNEY2OjQyNDMwRkU6NTk2NkY5Njo2OTZFMDQyMyIsInZpc2l0b3JfaWQiOiI0NTkzMDEwMDI5MjE5NDE1MDc1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f2f5e452870c72a20ca94b16e1d9ac886a29628ae8d4965a79d0e1174636aa11 |
| hovercard-subject-tag | issue:1918326997 |
| 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/20395/issue_layout |
| twitter:image | https://opengraph.githubassets.com/32d5ca8a90f13172a7b5f61fc7f691c5f3974633ee57678e3f1739bb523bcac7/PowerShell/PowerShell/issues/20395 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/32d5ca8a90f13172a7b5f61fc7f691c5f3974633ee57678e3f1739bb523bcac7/PowerShell/PowerShell/issues/20395 |
| og:image:alt | Summary of the new feature / enhancement As a heavy user of dynamic parameters, I often find myself tripping over their basic failures in constructability. Dynamic Parameters are needlessly difficu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | StartAutomating |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9b5131b207ddd175abf059a848d5f4302ec0606b02211b989013be49cf08593e |
| 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 | f8590a63bfc8093b241930ca57d536c9a50f9680 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width