PowerShell – Start-Process and Cmdline Switches
you are going to want to separate your arguments into separate parameter $msbuild = “C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe” $arguments = “/v:q /nologo” start-process $msbuild $arguments
you are going to want to separate your arguments into separate parameter $msbuild = “C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe” $arguments = “/v:q /nologo” start-process $msbuild $arguments
That’s how Start-Process was designed for some reason. Here’s a way to get it without sending to file: $pinfo = New-Object System.Diagnostics.ProcessStartInfo $pinfo.FileName = “ping.exe” $pinfo.RedirectStandardError = $true $pinfo.RedirectStandardOutput = $true $pinfo.UseShellExecute = $false $pinfo.Arguments = “localhost” $p = New-Object System.Diagnostics.Process $p.StartInfo = $pinfo $p.Start() | Out-Null $p.WaitForExit() $stdout = $p.StandardOutput.ReadToEnd() $stderr = $p.StandardError.ReadToEnd() Write-Host … Read more