-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Scoping Fun #18
Comments
Perhaps something similar to how psake is doing it? https://github.com/psake/psake/blob/master/psake.psm1#L252 This looks like any variables defined in the |
What about:
|
To answer my own question, it would still need to be script scope. That does work though. |
Why not have a File preamble similar to what Pester has ? |
A user might expect the following to work, and display
Var is 2
:Currently, this will display
Var is
, given fun with scoping.An ugly workaround would be to use environment variables, or script scope. This might be an acceptable solution given that tools like psake, the build script, or the CI/CD solution may already populate global or environmental variables:
These both successfully display
Var is 2
, but are not very friendly or intuitive to the user.Potential solution: Add code that extracts script scope variables into the current scope. This would be needed in DeploymentType scripts, and in Task based DeploymentTypes (perhaps we could inject it).
Am I missing anything? The examples above are running from the dev branch.
The text was updated successfully, but these errors were encountered: