Run PS script with parameter from batch file

11/01/2012 19:55

****************

file hop.bat

***************

 

@echo off
set curdir=%cd%
set name="Lukino"


echo "Pustam sa....z windows command liny"
cd\
rem path to PS script
cd C:\GBP.Install 
powershell .\pozdrav.ps1 %name%

cd\
cd %curdir%

 

 

 

 

 

*****************************

file pozdrav.ps1

*****************************

param ([string]$name)


write-host "Hello from Powershell, "$name
$input=read-host "How old are you?"
write-host "Really " $input "?"