How to execute parallel/ Threaded jobs in PowerShell
Many times we need to work in parallel when executing the Powershell commands. Today in this post I will tell how we can execute the commands in parallel. In my case, I have used these parallel jobs for the migration of SharePoint On-Prem to SharePoint Online using Sharegate, executing multiple instances and then monitoring those instances to initiate as soon as any of the instances is finished executing. Step 1: Installing the Module To leverage the benefit of the parallel jobs, we need to install the Module so to install the module, execute the following command Install-Module - Name " ThreadJob " - Scope AllUsers Once the module is installed, then you are ready to go. Step 2: Execute Parallel Jobs Now you can start parallel jobs in the background. Here is the sample for executing the parallel jobs $Job = Start-ThreadJob - FilePath " .\PowershellScript.ps1 " - ArgumentL...