-
Notifications
You must be signed in to change notification settings - Fork 21
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
Pass variables to webschema's "script" #16
Comments
script
I'd love to be able to do this. I'm not sure I can though - I will be actively pursuing a solution over this week while I'm at the MVP summit in Redmond. |
I'm not sure that we can pass an actual PS scriptblock, but as viable workaround we can create a new InitialSessionState, create Runspace using it, assign this Runspace to a PowerShell object, and then import current variables/modules into it. Unfortunately, while it's all can be done in PowerShell, I have no idea how to pass resulting Runspace to the Flancy. Probably C# code has to be extended with some method/property that would accept Runspace object. References:
|
More thoughts on a subject:
|
We need some way to pass variables/objects to webschema's
script
.Ideally,
script
should be passed and executed as an actual PowerShell scriptblock, with it's SessionState and so on. This way we could capture required variables withGetNewClosure
or pass them to scriptblock as arguments.Right now, if I understand it correctly, scriptblocks are used as text to build function that executed in nancy via PowerShell host:
The text was updated successfully, but these errors were encountered: