Title: Feature Request: Variable Parameter with switch-like capability · Issue #12104 · PowerShell/PowerShell · GitHub
Open Graph Title: Feature Request: Variable Parameter with switch-like capability · Issue #12104 · PowerShell/PowerShell
X Title: Feature Request: Variable Parameter with switch-like capability · Issue #12104 · PowerShell/PowerShell
Description: What I'm looking for is the ability to use a parameter to pass a variable, yet be able to act similar to a switch. Essentially... No parameter: PS>FunctionName Or, parameter used like a switch where it will utilize a default value PS>Fun...
Open Graph Description: What I'm looking for is the ability to use a parameter to pass a variable, yet be able to act similar to a switch. Essentially... No parameter: PS>FunctionName Or, parameter used like a switch wher...
X Description: What I'm looking for is the ability to use a parameter to pass a variable, yet be able to act similar to a switch. Essentially... No parameter: PS>FunctionName Or, parameter used like a swit...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/12104
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Feature Request: Variable Parameter with switch-like capability","articleBody":"What I'm looking for is the ability to use a parameter to pass a variable, yet be able to act similar to a switch. Essentially...\r\n\r\nNo parameter:\r\n`PS\u003eFunctionName`\r\n\r\nOr, parameter used like a switch where it will utilize a default value\r\n`PS\u003eFunctionName -Parameter`\r\n\r\nOr, parameter used with a specified override to the default value\r\n`PS\u003eFunctionName -Parameter 123`\r\n\r\nThe idea is that I have a need for a function to accept multiple switch style inputs to say enable/disable, use/don't-use a particular feature. To that end a switch parameter works fine. However, many of the parameters are not only a true/false but also a variable, and I want to be able to provide the user a way to override the default value. A second parameter could be specified and required with dynamic parameters, to which the the input might look as follows...\r\n\r\n`PS\u003eFunctionName -Parameter -ParameterOverride 123`\r\n\r\nBut, this is clunky at best and considering the function I'm presently trying to work with has need for 8 parameters of this style it's down right ugly to use from the users perspective.","author":{"url":"https://github.com/chaydock","@type":"Person","name":"chaydock"},"datePublished":"2020-03-11T16:35:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":29},"url":"https://github.com/12104/PowerShell/issues/12104"}
| 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:c3e93c2a-5353-f994-cd99-0614e960467f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CC4C:3677D5:A6CA65:E04F5B:6A5A8659 |
| html-safe-nonce | b4e47d69e0b705c4a44ff1c9677cf05b65e38a66ee4c9a411493805a75ce746d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzRDOjM2NzdENTpBNkNBNjU6RTA0RjVCOjZBNUE4NjU5IiwidmlzaXRvcl9pZCI6IjQyNjA0MDY1OTM2MDE1NzAzOTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 932d3014e0f8c3decc46639e3754645418b56c75bcbf35d3673d406e3e686274 |
| hovercard-subject-tag | issue:579396711 |
| 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/12104/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9c39303d7cb552fd2cefbf3f9799399aa4c483a0c62bc9eb98379a15480a6951/PowerShell/PowerShell/issues/12104 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9c39303d7cb552fd2cefbf3f9799399aa4c483a0c62bc9eb98379a15480a6951/PowerShell/PowerShell/issues/12104 |
| og:image:alt | What I'm looking for is the ability to use a parameter to pass a variable, yet be able to act similar to a switch. Essentially... No parameter: PS>FunctionName Or, parameter used like a switch wher... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chaydock |
| hostname | github.com |
| expected-hostname | github.com |
| None | 922bdba685ea48400234d557977f0e32d9adbae6f5125725b4f48cacc6801106 |
| 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 | 7c8a44665d760d73ead7e85d8f88b299152aa681 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width