Вот мой код:
$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
Что-то мне не хватает?
Спасибо