我有c#代碼,我想在PowerShell中找到此代碼的替代。我發現類似[ref]$parameter
但它不起作用。 我的代碼是:我怎麼可以在參數中聲明像powershell像c#
private static bool testfunction(string param1, out string param 2)
{
param1 = "";
param2 += "Hello";
return true;
}
請給我在PowerShell中的替代代碼。
我試試這個:
class tst
{
static test([ref]$param)
{
$param.Value = "world "
}
}
$test = "ddd"
$test
[tst]::test($test)
$test
這是行不通的。
什麼PowerShell代碼? – BACON
@BACON我在頂部使用這個命令。 – saftargholi
@Enigmativity這不是重複的 – saftargholi