Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Start powershell script within Powershell script with arguments

$
0
0

Hey

I am trying to start a powershell script within a powershell script.
This seems very easy - I thought, too.
But I need several additional things to make sure:
1. I can give additional parameters to the new powershell script.
2. The first script goes on running while the second one runs in parallel.
3. I can stop the process of second script from the frist script.
4. The second script is started with powershell.exe not powershell_ISE.

What I tried to do was the following:

$ProgressBar = Start-Process Powershell.exe -Argument "-ExecutionPolicy Bypass -File $ScriptPath\ProgressBar.ps1 -ProgressBarTitle $PBTitle -ProgressBarText $PBText"

Whereas "-File" and "-Executionpolicy" are parameters for Powershell.exe and "-ProgressBarText", "-ProgressBarTitle" are parameters for ProgessBar.ps1

I think the answer must be very simple but I don't get on it :(

Thank you for help in advance.

Kind Regards

mk-maddin


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>