Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 726 Bytes

File metadata and controls

12 lines (8 loc) · 726 Bytes

If a module function creates a variable in the parent scope then the variable is created in the module scope, not necessarily the calling scope.

  • Module1.psm1 exports the function New-Variable1 which creates a variable in the parent scope.
  • Test-Module1.ps1 calls New-Variable1 and fails to get the variable Variable1 in the current scope.

If a script function creates a variable in the parent scope then the variable is created in the calling scope.