0

I want to launch a powershell script in multiple windows with multiple parameters

foreach($Instance in $config){

    $MaxSamples = $UserInput.MaxSamples
    $SampleInterval = $UserInput.SampleInterval
    $instance = $Instance

        cmd /c start powershell -NoExit -Command {.\sqlcounters.ps1 $instance $SampleInterval $MaxSamples $OutputDirectory $Instance_$MaxSamples_iterations_with_db}

}

Could some one sugggest on how to specify the multiple parameters

1 Answer 1

1

Try the Start-Process cmdlet:

Start-Process powershell -ArgumentList "-NoExit -File c:\test.ps1",$arg1,$arg2,$arg3
Sign up to request clarification or add additional context in comments.

1 Comment

Wohooo Great Shay, Always to the rescue :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.