Saturday, February 25, 2017

Sample window power shell script to print using foreach loop

if($args){
foreach($i in $args){
write-host "Printing" $i
}
}

Execution:
./script1.ps1 "sachin"  "ganguly" "dravid"

No comments:

Post a Comment