I have approx 70 VC++2010 projects are there and I have created batch files for each project to compile it via command line and I want to compile multiple batch file (~4) at a time. So I have written one PowerShell script to call this batch files 4 at a time and wait until those 4 batch files are done. The script look likes below.
… // loop to assign 4 batch file to “myArry”
$myArray | %{
start-process $BuildFileName -ArgumentList “$arg[0]” -PassThru -WorkingDirectory $WorkingDir
} |Wait-Process
…
So when I run this PS script it works fine. Its starting each batch file (Cmd.exe) and it opens devenv.exe->devenv.com->msbuild.exe->cl.exe… So for all four batch files, these processes are running.
But the problem is when I run the same PS script remotely (Enter Ps session via another PC) it’s getting failed in between. And the Compilation log shows “Midl.exe” exited with some error codes (some of the error codes are related to Not Enough memory).
I increased memory(MaxPowershellMB) to 4096 MB but still facing the same issue. I even tried with 7000 MB but no luck