Reputation: 95
I'm unable to call powershell with start-process when i'm passing both scriptfile and parameters
start-process powershell d:\startTask.ps1 "param1" "param2" "param3"
My startTask.ps1 looks like below
param([string]$x="default",[string]$y="default",[string]$z="default")
echo "x: $x"
echo "y: $y"
echo "z: $z"
Upvotes: 0
Views: 109
Reputation: 60938
try:
Start-Process Powershell -ArgumentList "-noexit","-File d:\startTask.ps1 param1 param2 param3"
Upvotes: 2