Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

WriteObject enumerateCollection set to true not enumerating DataRowCollection in System.Data.DataTable #6453

Copy link
Copy link
@abhisheksinha89

Description

@abhisheksinha89
Issue body actions

Steps to reproduce

Create a simple cmdlet with this method as the ProcessRecord()

protected override void ProcessRecord()
{
        DataTable dt = new DataTable("test");
        dt.Columns.Add("Name", typeof(string));
        dt.Columns.Add("Age", typeof(string));
        DataRow dr = dt.NewRow(); dr["Name"] = "John"; dr["Age"] = "20";
        DataRow dr2 = dt.NewRow(); dr["Name"] = "Susan"; dr["Age"] = "25";
        dt.Rows.Add(dr); dt.Rows.Add(dr2);
        WriteObject(dt, enumerateCollection: true);
}

Expected behavior

Return type should be a System.Array with the 2 rows enumerated.
(This works on Powershell 5 with the full .NET Framework)

Actual behavior

Return type is a DataTable not a System.Array with the rows enumerated.

Environment data

> $PSVersionTable
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Committee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionIssue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.