How can i use alias only when i call my cmdlet function ?
This is my code
Function Deploy-Citrix {
[cmdletBinding(SupportsShouldProcess=$True)]
Param(
[Parameter(Mandatory=$true)]
[Alias("component")]
[ValidateNotNullOrEmpty()]
[string]$componentparam,
[Parameter(Mandatory=$true)]
[Alias("ip")]
[ValidateNotNullOrEmpty()]
[string]$ipaddressparam,
)
In this case for the second parameter for example, i can use the alias -ip
but i can also use -ipaddressparam
.
Deploy-citrix -componentparam "toto" -ipaddressparam "172.22.0.100"
Deploy-citrix -component "toto" -ip "172.22.0.100"
I can use both, but i want to disable the first one, i want to have alias only.
I know i can rename my variable, but i don't want to touch them in the whole script.
How can i achieve that?
I'm using Powershell V4.0
Thanks