poshud/pages/tables.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
$Cache:GridData =     @(
    @{
            Country = "MAURITANIA"
            Customers = 262
            FirstPurchaseDate = "5/30/2017"
        },
    @{
            Country = "NAURU"
            Customers = 649
            FirstPurchaseDate = "9/11/2017"
        },
    @{
            Country = "POLAND"
            Customers = 92
            FirstPurchaseDate = "8/8/2017"
        },
    @{
            Country = "SWITZERLAND"
            Customers = 830
            FirstPurchaseDate = "5/8/2017"
        },
    @{
            Country = "ISLE OF MAN"
            Customers = 641
            FirstPurchaseDate = "7/13/2017"
        },
    @{
            Country = "KYRGYZSTAN"
            Customers = 857
            FirstPurchaseDate = "7/30/2017"
        }
     )




$Basic = {
    New-UDTable -Title "Customers" -Headers @("Country", "Customers", "First Purchase Date") -FontColor "black" -Endpoint {
        $Cache:GridData | Out-UDTableData -Property @("Country", "Customers", "FirstPurchaseDate")
    }
}

New-UDPage -Name "Tables" -Icon table -Content {
    New-UDPageHeader -Title "Tables" -Icon "table" -Description "Display data in a static table." -DocLink "https://docs.universaldashboard.io/components/tables"
    New-UDExample -Title "Basic Table" -Description "Display data in a table." -Script $Basic
}