如果我创建一个简单的Powershell函数,例如
Function Hello {
[CmdletBinding( )]
Param (
[parameter()]
$Name
)
Begin{}
Process{
Write-Output "Hello $Name"
}
End{}
}
Run Code Online (Sandbox Code Playgroud)
然后使用Get-Command列出它Get-Command Hello,cmdlet被列为'CommandType'函数.为什么不将它列为'CommandType'cmdlet?
从模块导出时,我还发现我必须使用FunctionsToExport而不是CmdletsToExport.
它似乎并没有影响功能的使用,我只是好奇他们为什么这样列出.