You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ScriptMethods should know themselves, so they can optionally chain #20456
I can only think of one way you could mean "chain" but I'm not sure how that information would help with that. Could you elaborate?
Sure thing!
I want a method to return an updated $this if and only if the next ScriptMethod has a value. One cannot do it without callstack peeking in each ScriptMethod and knowing the name of the method.
I recently wanted to do something like this within Posh's "stackable" functions, which are used for prompt modifications.
The Engine WG discussed this and decided that we're not currently interested in providing information about the method's caller. However, we do think there is value in improving InvocationInfo for the InvokeWithPipe code path. We have opened issue #20500 to track that.
Activity
SeeminglyScience commentedon Oct 9, 2023
I can only think of one way you could mean "chain" but I'm not sure how that information would help with that. Could you elaborate?
StartAutomating commentedon Oct 9, 2023
Sure thing!
I want a method to return an updated $this if and only if the next ScriptMethod has a value. One cannot do it without callstack peeking in each ScriptMethod and knowing the name of the method.
I recently wanted to do something like this within Posh's "stackable" functions, which are used for prompt modifications.
This is an example of a painful workaround (letting an additional $true boolean are be a signal to pass thru).
SeeminglyScience commentedon Oct 16, 2023
The Engine WG discussed this and decided that we're not currently interested in providing information about the method's caller. However, we do think there is value in improving
InvocationInfofor theInvokeWithPipecode path. We have opened issue #20500 to track that.StartAutomating commentedon Oct 16, 2023
Patrick Meinecke (@SeeminglyScience) thanks for the update, I hope the improved invocation info is enough to be able to accomplish the scenario.
Close it?
SeeminglyScience commentedon Oct 16, 2023
The bot will do that now that the label
Resolution-Declinedis applied, but you're more than welcome to do so as well. Either way works!microsoft-github-policy-service commentedon Oct 16, 2023
📣 Hey James Brundage (@StartAutomating), how did we do? We would love to hear your feedback with the link below! 🗣️
🔗 https://forms.office.com/r/P926k48jRJ