Hi,
I would like to create an advancedmodule with a cmdlet function which performs some logic and adds some pssnapins. This is the code:
function Add-DefaultSnapIns { [CmdletBinding()] param() begin {} process{ # ... Add-PsSnapIn SnapInName } end {} }
export-module -function Add-DefaultSnapIns
If I invoke the function from any point (for instance, a powershell prompt), the operation succeeds, but the snapin is not available outside of the scope of the function. The snap-in appears registered, but none of its functions have been exported to the global scope. How could I solve it?
Thank you