Passing arguments in windows powershell scripting

Create a simple script “s1.ps1” with below content.
 
echo $args.length

for ([int]$i=0;$i -lt $args.length;$i++) {
echo “Argument number $i is $($args[$i])”
}

Then you can invoke above script using below command. Here is the sample output of above command.
 
> ./s1.ps1 <param1> <param2>

Web development and Automation testing

solutions delivered!!