By default, only functions defined in a module are visible outside of the module. In other words, if you define variables and aliases in a module, they won't be available except in the module's code.
To override this behavior, you can use the Export-ModuleMember
cmdlet. It has parameters called -Function
, -Variable
, and -Alias
which allow you to specify exactly which members are exported.
It is important to note that if you use Export-ModuleMember
, only the items you specify will be visible.