这里是我的代码:PowerShell中传递命令行参数
$script={
Write-Host "Num Args:" $args.Length;
Write-Host $args[0]
}
Invoke-Command -ScriptBlock $script
当我运行
powershell.exe .\test.ps1 one two three
我
Num Args: 0
我想我会得到
Num Args: 3
One
我错过了什么?
感谢