View Single Post
Old 05-15-2008   #6 (permalink)
Romu


 
 

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:
Quote:

> Romu wrote:
Quote:

> > 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.
>
> Yup, the solutions Keith and I proposed could be embedded within your
> 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 SpecsSystem Spec