Skip to content

OCGV: Out-ConsoleGridView does not accept XML data #97

Open
@jasper-zanjani

Description

@jasper-zanjani

While manipulating XML data and testing Out-ConsoleGridView (Powershell 7.0.0 on Windows 10.0.19603), I noticed that the cmdlet appears to demand data of a certain datatype. For testing, a sample XML file can be found here.

[xml]$xml = Get-Content '.\sample.xml'

Tabular output from $xml can be viewed in the terminal

$xml.catalog.book

Output

id           : bk101
author       : Gambardella, Matthew
title        : XML Developer's Guide
genre        : Computer
price        : 44.95
publish_date : 2000-10-01
description  : An in-depth look at creating applications 
                     with XML.

id           : bk102
...

Piping to Out-GridView produces expected output

$xml.catalog.book | Out-GridView

out-gridview

However, piping to Out-ConsoleGridView produces an error

$xml.catalog.book | Out-ConsoleGridView

out-consolegridview
The BaseType of $xml.catalog.book is System.Array

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions