Using this command result is divided on two lines, first trimmed on 59 characters, second - all other characters
$command ='nuget.exe list "Json.NET" -source "https://www.nuget.org/api/v2/"'
(Invoke-Expression "$command") | out-file C:\test.txt
It looks like some strange word wrapping and appears only in Windows PowerShell ISE (Powershell.exe works fine)
Increase the buffer size doesn't work for me
$host.UI.RawUI.BufferSize = new-object System.Management.Automation.Host.Size(512,50)
this works
start-process $nugetExe $command -wait -WindowStyle Hidden -RedirectStandardOutput C:\test.txt -RedirectStandardError C:\error.txt
but it works only if exclude "RedirectStandardError", if it exist - wrapping still in place The same issue if I use
$process.StartInfo.RedirectStandardError = $true;