有人向我指出(在
如果您以不同的方式命名包裝器和包裝函式,則可以檢查該函式是否已使用類似...

否則,您需要獲得更多創意。
這就是說,謹慎行事。像這樣的遠程代碼執行充滿了安全問題,尤其是在我們談論它的方式上,即沒有對Test-ConnectionAsync.ps1.
uj5u.com熱心網友回復:
cls
function Ping-Subnet{
$toImport = IRM "https://raw.githubusercontent.com/proxb/AsyncFunctions/master/Test-ConnectionAsync.ps1"
NMO([ScriptBlock]::Create($toImport))|Out-Null
$MyInvocation.Line|IEX
}
function Test-ConnectionAsync{
$toImport = IRM "https://raw.githubusercontent.com/proxb/AsyncFunctions/master/Test-ConnectionAsync.ps1"
NMO([ScriptBlock]::Create($toImport))|Out-Null
$MyInvocation.Line|IEX
}
Ping-Subnet -Result Success
Test-ConnectionAsync -Computername $env:COMPUTERNAME
結果:
Computername Result
------------ ------
192.168.1.1 Success
192.168.1.2 Success
192.168.1.146 Success
Computername IPAddress Result
------------ --------- ------
HOME-PC fe80::123:1234:ABCD:EF12 Success
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/468992.html
上一篇:如何從多個資料框創建字典?
