I would like to utilize my own custom namespaces in a PowerShell .ps1 script or a .psm1 module. Is this possible? If so, what is the syntax to do this?
I found a related link here: Breaking the Powershell namespace limit of global,script
It seems like I will need to make my own custom object, or possibly use a custom associative array for this?
I would like to be able to call my function like this:
[MyCoolNamespace]::Get-CrazyYall
A module name is similar to a namespace. For example:
Microsoft.PowerShell.Core\Get-Command
is the same as
Get-Command
Normally you don't use module qualified names when invoking commands (cmdlets, functions, or aliases), but it comes in handy if you do have a conflict or want to be 100% certain you are invoking the function you meant to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With