![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Running an external process asynchronously Hi all, All the question is in the title; I need to run an external process from my powershell script asynchronously, I want powershell to continue my script execution as soon as this process is started. Any idea? Thanks in advance |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Running an external process asynchronously Romu wrote:
http://jtruher.spaces.live.com/blog/...628D!130.entry PowerShell v2 CTP1/CTP2: get-help start-psjob Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||
| Guest | Re: Running an external process asynchronously "Romu" <Romu@xxxxxx> wrote in message news:26878AEF-39AC-412F-96A3-5BB7775BC0B0@xxxxxx
can use Start-Process like so: foo.ps1 -------- echo "Before" Start-Process csc.exe -arg '/?' -noshellexecute echo "!!!!! After !!!!!" -- Keith Hill http://www.codeplex.com/powershellcx | ||||||||||||
My System Specs![]() | |||||||||||||
| | #4 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Running an external process asynchronously Many thanks guys, Indeed I just realized that the thing I need to call asynchronously is a powershell function of my own. An example : #The function function Synchronise(computername) { .... } #The script Synchronise(PC1) Synchronise(PC2) Synchronise(LINUX1) Synchronise(MAC1) My function Synchronise is called several times and I need to run asynchronously. This function is used to synchronise a set of files and folders on computers and it's called several times because we synchronise several computers. I would like to see the script to continue once the synchronisation is launched. Thanks in advance for your help. romu "Keith Hill [MVP]" wrote:
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #5 (permalink) | ||||||||||||
| Guest | Re: Running an external process asynchronously Romu wrote:
functions. The only thing not evident to me (this early in the morning ;-)) is if you expected to somehow return the results from the function. I can't think of another easier way for you to attempt what you want. Marco | ||||||||||||
My System Specs![]() | |||||||||||||
| | #6 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Running an external process asynchronously Thanks for quick answer Marco, No the function doesn't return any result, it is just a "run and forget" function. And I can't make the inside aynchronous as the actions performed by the function must be sequential. So the whole function must be aynschronous. "Marco Shaw [MVP]" wrote:
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #7 (permalink) | ||||||||||||
| Guest | Re: Running an external process asynchronously Romu wrote:
you willing/wanting to try out, and we will go from there: #1: v1: Use Jim's background jobs. #2: v1/v2 CTP: Use Keith's PSCX. #3: v2 CTP: Use *-PSJobs If in a prod environment, and you can't go installing 3rd party PowerShell add-ons, then it seems #1 is your option. It is just some PowerShell scripts that use existing functionality provided by PowerShell v1. Marco | ||||||||||||
My System Specs![]() | |||||||||||||
| | #8 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Running an external process asynchronously Thanks Marco, I've just taken a look at the jim's background jobs and I think this is what I need. Thanks for your help. "Marco Shaw [MVP]" wrote:
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can I get information about running process? | David Kriz | PowerShell | 2 | 08-04-2008 01:30 PM |
| Unknown Running Process | Michael | Vista security | 6 | 03-27-2008 06:28 PM |
| How can I determine what process is running? | FoxGuy | Vista General | 1 | 12-03-2007 01:15 PM |
| Process Running Elevated? | Najash | Vista installation & setup | 0 | 07-09-2007 06:40 PM |
| Run tasks asynchronously: external files vs. script blocks | OK | PowerShell | 7 | 11-05-2006 01:38 PM |