When specifying using namespace
within PowerShell module or script file, is there a scope associated with the directive into which namespace symbols are being introduced?
Or are namespace symbols introduced into global session state avoiding the PS scope modifiers?
using namespace System.Management.Automation.Runspaces
For example if we specify using namespace
inside module it would be great if this applies to module scope only.
Likewise if we specify using namespace
inside script file it would be great if this applies to that script only unless dot sourced.
I didn't test any of this and was not able to find documentation regarding this question.
question from:https://stackoverflow.com/questions/65645394/what-is-the-scope-of-using-namespace-in-powershell