I have a module with several functions.
Since I called them the non-PowerShell way, I want to rename them. But since the module is already in use, I want to keep the old function names.
The best way to achieve this seems to be using aliases. I already have a module manifest that states:
AliasesToExport = '*'
So, I created an alias in the module with New-Alias -Name test -Value oldFunctionName .
Functions were imported as usual, but there was no alias.
I know that I can use the Export-ModuleMember module in the module. But I have a manifest that should already take care of this.
So here are finally my questions:
Why aren't aliases exported through the manifest?
Is there a special place in the function itself where I can or should define an alias? Or do I need to use the New-Alias โโcmdlet somewhere special?
I was thinking of something like parameter aliases:
[parameter(Mandatory=$true, Position=0)][Alias("name","path")][String]$filename
But for functions instead.
source share