|
RE: Validation needed: Tabular output throws OutofMemoryException erro With a laptop 1.8 Ghz centrino, 2GB mem, running on Vista beta2 this produces
the same result.
Guess is has to do with filling up the column space to create a table with
the width given. using a width of 214748364 (one digit less) on the same
command allready creates a .txt file 1.7 GB in size (takes a while to create)
:-)
A list won't use up the width given because the lines aren't long enough.
Giving this width just results in lines not being cut off. Much less memory
is used this way.
I don't know if these assumptions are correct, but seems logical to me. I do
like to know if my guess about the table width is correct and could it be
that a table with less characters wouldn't produce this error, but than
system memory would matter asswel.
grt
Aspa
"Alex K. Angelopoulos [MVP]" wrote:
> Could I get someone else to validate errors using the maximum
> possible -width for Out-File when output is going to be tabular?
>
> PS> Get-Command | Out-File -FilePath c:\temp\output.txt -Width 2147483647
> out-lineoutput : Exception of type 'System.OutOfMemoryException' was thrown.
>
> PS> Get-Command | Out-File -FilePath c:\temp\output.txt -Width 0x7fffffff
> out-lineoutput : Exception of type 'System.OutOfMemoryException' was thrown.
>
> PS> Get-Command | Format-Table -Property * | Out-File -FilePath
> c:\temp\output.txt -Width 0x7fffffff
> out-lineoutput : Exception of type 'System.OutOfMemoryException' was thrown.
>
> Note that if I either explicitly use Format-List or use Select-Object *
> (which forces list formatting) that it works fine:
>
> PS> Get-Command | Format-List -Property * | Out-File -FilePath
> c:\temp\output.txt -Width 0x7fffffff
> PS> Get-Command | Select-Object -Property * | Out-File -FilePath
> c:\temp\output.txt -Width 0x7fffffff
> PS>
>
>
> |