如何在Set-Alias中设置参数?
Set-Alias -Name remsub -Value Remove-GitSubmodule -GitModulePath $local:PSScriptRoot
function Remove-GitSubmodule {
Param
(
[Parameter(Mandatory=$true)]
[string]$GitModulePath,
[Parameter(Mandatory=$true)]
[string]$ModuleName
)
}
我收到此错误:
Set-Alias : A parameter cannot be found that matches parameter name 'GitModulePath'.
At my.psm1:27 char:51
+ ... -Alias -Name remsub -Value Remove-GitSubmodule -GitModulePath $local: ...
+ ~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Alias], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.SetAliasCommand