传递给命令时,Powershell 似乎删除了空字符串参数。我有这个代码
PS D:\> $b.name = "foo bar"
PS D:\> ./echoargs $b.name
Arg 0 is D:\echoargs.exe
Arg 1 is foo bar
PS D:\> $b.name = ""
PS D:\> ./echoargs $b.name
Arg 0 is D:\echoargs.exe
您可以假设 $b 有一个 'name' 成员。即使值为空字符串,我如何将其作为参数传递给 exe。我试过使用呼叫操作员但没有成功。