Search

v3 Out-Gridview functionality is crippled if a row of data contains more than 9 lines of text by wtgreen

Active

4
0
Sign in
to vote
Type: Bug
ID: 775797
Opened: 1/4/2013 7:03:49 AM
Access Restriction: Public
2
Workaround(s)
1
User(s) can reproduce this bug
The v3 Out-GridView is no longer effective if text data contains more than 9 lines of text. If the data in a column is particularly large, the row won't expand vertically past 9 lines of text and the displayed data is truncated, showing ... (ellipses) instead. Copying the row to the clipboard likewise only copies the abbreviated info and the filter criteria only searches the first 9 lines.

We have a script that parses a log file, outputting date/time info, errors and XML data using out-gridview. In v2 if the XML data in a column was large, the row sizes of the gridview would expand vertically to accommodate the long string. We can see the data, copy data we need to investigate further to the clipboard and search the data using the filter criteria. For some of us this ability is so essential to our work that we cannot install v3 because we cannot limit ourselves to only filtering on the first 9 lines of text.

Screenshot showing truncated data and log file: http://social.technet.microsoft.com/Forums/getfile/186894

With v3 installed, running "Powershell.exe -Version 2" does not help since the out-gridview functionality does not work in that instance. See: https://connect.microsoft.com/PowerShell/feedback/details/774972/out-gridview-fails-to-show-in-v2-after-v3-update
Details (expand)
How often does this happen?
Always Happens

Have you seen this problem before in this product?

No, this is new to the most recent version
Reproduction Steps
Run: ((1..2)|%{ ((1..($_*5))|%{ "Line #$_"}) -join "`r`n" }) | ogv

This will display two rows of data, the 1st row having 5 lines of text, the 2nd row having 10 lines of text.
Expected Results
In v2, a row would expand vertically to show all text in a cell, limited to the gridview window size, so in the example above the 2nd line of text displays "Line #1"... "Line #10" - 10 lines of text. Highlighting the row and copying it to the clipboard via Ctrl-C copies all text to the clipboard. Searching in the filter criteria for "Line #10", the 2nd row is highlighted.

In v3, a row only expands to show 10 lines of text, the first 9 displayed and the 10th and later lines truncated and replaced with ellipses, "...", on-screen. Copying a truncated row to the clipboard copies only the truncated data. Searching using the filter criteria only searches the truncated text, so searching for "Line #10" in the example above, no data is displayed even through the 2nd row of data does contains the string.

Interesting even though v3 only displays the truncated data and will not search the full data, the full data is retained internally. Using the new "-PassThru" or "-outputmode multi", the full data of selected rows is passed down the pipeline even if it is no longer displayed or filterable.
File Attachments
0 attachments
Sign in to post a comment.
Sign in to post a workaround.
Posted by wtgreen on 5/9/2013 at 2:28 PM
John_Kopp... thank you! It appears as long as the data has carriage return chars in it, "`r", it will display on separate lines in the gridview, and then when cut-and-pasting that data into another editor, the ones I tried will add the missing linefeeds. That's a truly effective work-around. It shouldn't be necessary, and I could see where it might cause some problems for people depending on their use, but I'm glad to have it as an option.
Posted by John_Kopp on 2/4/2013 at 7:40 AM
Hi,
I found a strange solution.
By running ($_).Message.replace("`n","") on a text data that has more than 9 rows, the Out-GridView started to show more than 9 vertically lines.
Works on powershell v3