How to multiple session on local host for multiple scripst

Hi Team,

I have a requirement where have to run multiple commands at a time and each command should use separate PowerShell session.

For example, I have 100 commands in a text file, the PowerShell should read the content of the text file and run all commands parallel. If we run normally, the commands are running sequential, the second line will run only after completing the first line. In my environment, each command is taking more than 2 days. If we run all commands parallel then the script will complete within 3 days.

The scripts look like below

C:\ASC_Tools\emcopy64.exe “C:\Test\Source\text1” “C:\Test\Dest\text” /s /sdd /de /r:3 /w:3 /c /nosec /cm md5 /th 3 /f /tee /log+:“C:\test\test.log”
C:\ASC_Tools\emcopy64.exe “C:\Test\Source\text2” “C:\Test\Dest\text2” /s /sdd /de /r:3 /w:3 /c /nosec /cm md5 /th 3 /f /tee /log+:“C:\test\test1.log”

 

Could you please help me with this.

 

 

Duplicate of : https://powershell.org/forums/topic/how-to-run-multipe-commands-by-using-multiple-ps-sessions/