PowerShell函数当做变量传递给另一个函数

 

function fts($a,$b){
$sum=$a+$b
Write-Host $sum
}


function hs($fun,$a,$b){
$c = 32
#调用函数
Invoke-Command $fun -ArgumentList $a,$c


}

#函数hs调用fts函数 hs
${function:fts} 33 22

 

posted on 2020-08-03 17:13  momingliu11  阅读(492)  评论(0编辑  收藏  举报