Is it possible to call powershell cmdlets asynchronously? Is it possible to call powershell cmdlets asynchronously? powershell powershell

Is it possible to call powershell cmdlets asynchronously?


If you're on PowerShell 2, you can use background jobs.

From the help:

about_Jobs

When you start a background job, the command prompt returns immediately, even if the job takes an extended time to complete. You can continue to work in the session without interruption while the job runs.

So you can use

Start-Job -ScriptBlock { cmdlet1 }Start-Job -ScriptBlock { cmdlet2 }

However, you need to have PowerShell configured for remoting, even when running a job locally.

I also stumbled over this:


If you need to stay on PowerShell v1, see if you can use the PSEventing snap-in.


Try:

cmd.exe /c call powershell cmdlet1cmd.exe /c call powershell cmdlet2