I have imported module “ModuleFoo.psm1” to my script: “ModuleBar.ps1”
And I call a method which is in the imported module that does dot sourcing to function BarFunction.ps1:
function Dot-SourceBarFunction()
{
. "\BarFunction.ps1"
}
Can I make this BarFunction.ps1 accessible from the parent scope that is : ModuleBar.ps1?
This should just work e.g.:
This outputs
Get-Foo called. Functions default to public visibility in modules so when you dot-source the script that pulls in functions within a module, those are automatically made public.