-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incremental Dynamic Parameter Bind #361
base: master
Are you sure you want to change the base?
Conversation
@SydneyhSmith When do things like this get reviewed? I would love to be part of the conversation. |
@JamesWTruher can you see if the Engine WG can review this? |
I'd really love to be a part of the conversation with the working group. This is a non-breaking change, only net new functionality but the last time they reviewed it I was told to create an RFC so I did. |
@SteveL-MSFT Community call is tomorrow, still looking for feedback on this. |
I would really really like to have this feature. So much easier to write and I have several use cases. |
Would love to see this in PowerShell it would open up some interesting and more complex use cases not possible with the current implementation. |
I could definitely find use in this, seems useful for complex multi-site automation tasks that may have a varying set of environments. |
+1. Have some existing modules that use dynamic parameters which would be streamlined with this. This would also open the door for less confusion when it comes to writing user-driven PowerShell modules (i.e. a helper module for technical folks that are not necessarily PowerShell savvy). This would be awesome. |
+1 This would make it substantially easier to deal with situations such as the example, which likely has equal application in dealing with the mess of versions and channels of Office/Apps for Business/Enterprise besides Edge, in another Microsoft example. This would be helpful in automating both with larger scripting toolsets and in adding better validation to more complex system admin and management scripts, so I support the change. |
Anything Darren writes generally makes my life easier as one of his customers. Please consider the changes and merge so many, MANY people can benefit from his recommendations. Thanks. |
I think this will add a lot of incentive for people to jump on dynamicparams. Currently, they don't seem to be as robust as one would assume for something called "dynamicparams". |
I 100% agree with this- it seems like Darren is the one trying to make the name true here |
I’d love to see this pushed into production. Would be super helpful. |
So, net new functionality with no breaking changes. Sounds like a win. What's the problem? |
Agree with all the above comments - can this be prioritized for inclusion ASAP? This PR is already months old. |
This would be a huge game changer for sure. |
Add one more to the list that needs this! |
I hope this gets implemented dkattan |
Very needed for partners |
I think this would be a cool addition! It could make scripts way smarter by adapting on the fly as you define parameters. |
Summary
Incremental Binding: As
RuntimeDefinedParameter
objects are written to the output in thedynamicparam
block, they are immediately bound if an argument is available. This behavior differs from the current state, where all parameters are bound after the entiredynamicparam
block has executed.Variable Creation: When a
RuntimeDefinedParameter
is bound, a variable with the name of that parameter should be created in thedynamicparam
block scope. This makes the bound value immediately available for subsequent logic in thedynamicparam
block.I already have a PR with the required code changes: PowerShell/PowerShell#20069
Example
For brevity, this example assumes a user-supplied
New-Parameter
function.