相关疑难解决方法(0)

有没有办法从函数中检索PowerShell函数名?

例如:

function Foo { 
    [string]$functionName = commandRetrievesFoo
    Write-Host "This function is called $functionName"
}
Run Code Online (Sandbox Code Playgroud)

输出:

PS > Foo
This function is called foo
Run Code Online (Sandbox Code Playgroud)

reflection powershell function

19
推荐指数
3
解决办法
2万
查看次数

标签 统计

function ×1

powershell ×1

reflection ×1