Please feel free to provide feedback or file bugs here.

Out-GridView fails to display data for properties starting or ending with whitespace characters.

Out-GridView fails to display data for properties starting or ending with whitespace characters.

Problem description:
I find this problem usually when loading csv files or other data source in powershell and then during working with the data I sometimes get empty columns in Out-GridView. I found that a blank as the first or last character of a property name will make Out-GridView display the column name but the rows data are not being shown.

Steps to reproduce:
$data = 1..10 | ForEach-Object {
New-Object -TypeName PSCustomObject -Property @{"NormalColumn" = "Normal$_"; " ThisDoesNotDispayData" = "Hidden$_"; "NeitherDoesThis " = "AlsoHidden$_"}
}
$data | Out-GridView

This will generate and example of data where 2 of the columns start or end with blank character and thus Out-GridView show the column but no data for each of the 10 objects.

Expected results:
Out-GridView should show the data from the properties on the objects since no filter has been applied anywhere, and since it is displaying the column name it can fool the user into thinking the objects has no data in those properties.

Just outputting $data or $data | Format-Table will show the correct values on the objects.

4 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Per Martin Møller shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base