Couple of Questions

I have a couple of newbie questions I am thinking. I have looked at the documentation, but not sure how to fix these 2 issues.

  1. When I grab a select query and put it into a UDGrid - I get the Headers included in the first row. I tried using Select- Object and a foreach loop to get rid of the header in the first row, but no luck ( As an aside - I have another grid where I use an array created from AD and I do not have this same problem.) I am thinking I can run a foreach loop and then an if statement to get rid of the first row, but I was hoping for something more direct.

  2. This grid I am creating has 28 columns. It is mostly so the user can review the contents and then export to CSV. The problem is the grid goes all the way to the right off the screen, but the UDCard does not and that looks really bad… How can I expand the the UD card to fit the grid properly or better yet hide empty columns from the grid view, but still include for the export to CSV.



Hi @wmcgilvery

Sounds like the headers are included in the data, and it’s a query related error not grid-related.
Simple fix:

$data | select-object -skip 1 | out-udgriddata

Either that or look into the module you use to fetch the data.

As for the 2nd, it’s a tough one.
Haven’t actually tried to play with the CSS to have this work, but it should be doable to have a horizontal scroll for the overflow.
28 columns if quite alot though :slight_smile:

Hi again @wmcgilvery

To make the card scrollable when overflowing you’d need to add the following CSS:

    '.card-content' = @{
        overflow = 'scroll'

Happy hunting!

1 Like

Thanks - The headers only appear when a do a select query from SQL, I don’t see anything different when I run it directly in powershell console. Anyways, I will try the skip 1 - I had done a foreach with the if satement, but this looks a lot cleaner.

1 Like

Thanks for the tip - I will give that a try.

1 Like

Thanks - the overflow worked.


1 Like