Skip to content

"Get-ChildItem | Format-Wide -AutoSize | Out-String" can't work on Powershell 6.0.1 & 6.0.2 #6471

@andot

Description

@andot

Steps to reproduce

Get-ChildItem | Format-Wide -AutoSize | Out-String

or

Get-ChildItem | Format-Wide -AutoSize | Out-String -Stream

Expected behavior



    Directory: C:\Users\andot\Documents\WindowsPowerShell\Modules\lolcat\1.0.1



.git                        LICENSE
lolcat.psd1                        lolcat.psm1
Out-Rainbow.psm1                   Out-StripAnsi.psm1
README.md                   screenshot.png

Actual behavior

out-lineoutput : Array dimensions exceeded supported range.
At line:1 char:1
+ Get-ChildItem | Format-Wide -AutoSize | Out-String -Stream
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [out-lineoutput], OutOfMemoryException
+ FullyQualifiedErrorId : System.OutOfMemoryException,Microsoft.PowerShell.Commands.OutLineOutputCommand

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.1
PSEdition                      Core
GitCommitId                    v6.0.1
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
> $PSVersionTable                                                 
Name                           Value
----                           -----
PSVersion                      6.0.2
PSEdition                      Core
GitCommitId                    v6.0.2
OS                             Linux 4.4.0-43-Microsoft #1-Microsoft Wed Dec...
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

If no -AutoSize param, the result will be fine. And it works well in WindowsPowerShell 5.1 with or without -AutoSize param.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions