Home Forums Programming Powershell Powershell Multithreading with SQL Agent RE: Powershell Multithreading with SQL Agent

  • I think that you are using the wrong technique.

    Dependent upon how you are creating the threads there are many synchronisation techniques available to .NET code but for PowerShell in particular there is the Wait-Job command.

    Get-Job | Wait-Job

    The documentation has the following to say about the above code: Suppresses the command prompt until one or all of the Windows PowerShell background jobs running in the session are complete.

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!