Powershell 2.0 Param Błąd słowa kluczowego
Używam systemu Windows 7 RTM. Powershell 2.0 jest instalowany domyślnie. Korzystam z doskonałego środowiska Windows Powershell ISE do edycji moich skryptów. Mam następujący skrypt:
Param($p)
Param($d)
echo $p $d
Zapisuję skrypt jako SayItAgain.ps1. Kiedy próbuję uruchomić ten skrypt z interaktywnej powłoki w taki sposób:
./SayItAgain -p "Hello"
Otrzymuję następujący błąd:
The term 'Param' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling o
f the name, or if a path was included, verify that the path is correct and try again.
At C:\users\cius\Code\powershell\SayItAgain.ps1:2 char:6
+ Param <<<< ($destination)
+ CategoryInfo : ObjectNotFound: (Param:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Czy to znany problem, czy po prostu używam go źle?