-
This code is working as intended: What's the problem here? The documentation says that dot sourcing executes code in the current scope. So this should work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The variables for $using: must be provided as arguments to the code that is running. PowerShell achieves this by scanning the AST of the scriptblock provided to |
Beta Was this translation helpful? Give feedback.
The variables for $using: must be provided as arguments to the code that is running. PowerShell achieves this by scanning the AST of the scriptblock provided to
-Parallel
and finds any$using:
statements. In your example the$using:
statement is inside a separate script which is invoked when the block is run rather than being included at parse time so PowerShell has no way of knowing about it when parsing the original scriptblock to run.