Out-Host and Out-File both work, but Out-Gridview doesn't

Welcome Forums General PowerShell Q&A Out-Host and Out-File both work, but Out-Gridview doesn't

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
8 months, 4 weeks ago.

  • Author
    Posts
  • #127323

    Participant
    Topics: 73
    Replies: 119
    Points: 507
    Rank: Major Contributor

    I have a very simple PS script which ends in outputting a CSV file.

    When I am testing such outputs (CSV), I usually use Out-Gridview (or Out-Host) to see the results quickly and then change the script to Out-File when the code is "truly final".

    For this script (not shown) when I use Out-Host or Out-File, I get the exact correct results.

    But when I use Out-Gridview, I get nothing, i.e., no screen displays and the script just returns to the PS prompt.

    The CSV file is just 4 columns (fields) and well under 80 characters total.

    Is there a reason for this behavior?

    Would be grateful for any tips, advice or suggestions.

  • #127335

    Senior Moderator
    Topics: 8
    Replies: 1009
    Points: 3,281
    Helping Hand
    Rank: Community Hero

    Can you share the code and a sample CSV, That will help us to understand the problem.

  • #127353

    Participant
    Topics: 73
    Replies: 119
    Points: 507
    Rank: Major Contributor

    My apologies Mr Kvprasoon.

    Out-Gridview was working.  It was the fact that its window was hidden behind the VS Code window which took up the whole screen and escaped my attention.  Everything is working fine. Sorry!

The topic ‘Out-Host and Out-File both work, but Out-Gridview doesn't’ is closed to new replies.