Currently ArmDslProviderScriptProducer generates a large string of several function definitions (e.g. function keywordName { }) and dot sources it.
If it instead produced a Dictionary<string, ScriptBlock> (where string is the keyword/function name and ScriptBlock is the body) it could be passed to ScriptBlock.InvokeWithContext. That method will start a new scope and then define the functions to avoid overriding keywords from the current scope when a naming conflict occurs.
Currently
ArmDslProviderScriptProducer
generates a large string of several function definitions (e.g.function keywordName { }
) and dot sources it.If it instead produced a
Dictionary<string, ScriptBlock>
(wherestring
is the keyword/function name andScriptBlock
is the body) it could be passed toScriptBlock.InvokeWithContext
. That method will start a new scope and then define the functions to avoid overriding keywords from the current scope when a naming conflict occurs.