$psi = New-Object System.Diagnostics.ProcessStartInfo $psi.FileName = "dotnet" $psi.Arguments = "exec d:\JDRelated\JD22SRC_Build\main\build\sharpmake\sharpmake_1.8.0\Sharpmake.Application.dll `"/sources(@\`"d:\JDRelated\JD22SRC_Build\main\build\sharpmake\main.cs\`") /project(\`"JD2022\`") /branch(\`"TU1\`")`"" $psi.UseShellExecute = $false $psi.RedirectStandardOutput = $true $psi.RedirectStandardError = $true $p = [System.Diagnostics.Process]::Start($psi) $stdout = $p.StandardOutput.ReadToEnd() $stderr = $p.StandardError.ReadToEnd() $p.WaitForExit() Write-Output "STDOUT:" Write-Output $stdout Write-Output "STDERR:" Write-Output $stderr