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
1 week, 3 days ago.

  • Author
    Posts
  • #127323

    Participant
    Points: 180
    Rank: Participant

    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

    Participant
    Points: 814
    Helping Hand
    Rank: Major Contributor

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

  • #127353

    Participant
    Points: 180
    Rank: Participant

    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!

You must be logged in to reply to this topic.