Site icon Franky's Web

Tip: PowerShell Universal Dashboard

Attractive dashboards can be created with many different applications, for example Kibana and Grafana. Dashboards can also be created directly with PowerShell. Ironman Software offers the "Powershell Universal Dashboard" module for this purpose. The Community Edition can be used free of charge and has only a few restrictions compared to the Enterprise Edition.

Here is an overview of the PowerShell module:

In my opinion, the price for the Enterprise Edition is more than fair (from 49.99 $). The Enterprise Edition also includes the option to manage permissions for dashboards. Here is a comparison of the features between Community and Enterprise Edition:

So if you are looking for a way to create appealing dashboards natively with PowerShell, you can test PowerShell Universal Dashboards.

The free Community Edition can be downloaded here:

The module can also be installed directly with the following command:

Install-Module -Name UniversalDashboard -RequiredVersion 2.3.2

Note: If the installation of the module indicates that a newer version of PowerShellGet is required, you can find instructions for updating here: Update PowerShellGet and PackageManagement

Here is a small PowerShell script which fills a simple dashboard with dummy data:

Get-UDDashboard | Stop-UDDashboard

$Dashboard = New-UDDashboard -Title "FrankysWeb Demo Dashboard" -Content {
    New-UDRow -Columns {
        New-UDColumn -Size 6 -Content {
			$Pie = @(
				@{Server="Server 2019";Count=10}
				@{Server="Server 2016";Count=20}
				@{Server="Server 2012";Count=15}
				@{Server="Server 2008";Count=7}
				)
            New-UDChart -Title "Server Betriebssysteme" -Type "Doughnut" -Endpoint {
				$Pie | Out-UDChartData -LabelProperty "Server"  -Dataset @(
					New-UDChartDataset -Label "Server" -DataProperty Count -BackgroundColor @("#4286f4", "#41bef4", "#408cad","#70cde0") -BorderColor @("#000000", "#000000", "#000000","#000000") -BorderWidth 1
					)
			} -Options @{cutoutPercentage = 0}
		}
		New-UDColumn -Size 6 -Content {
			New-UdChart -Title "Speicherplatz" -Type Bar -Endpoint {
				$Bar = @(
					@{DeviceID="C:";FreeSpace=16;Size=20}
					@{DeviceID="D:";FreeSpace=13;Size=23}
					)
                $Bar | Out-UDChartData -LabelProperty "DeviceID" -Dataset @(
                    New-UdChartDataset -DataProperty "Size" -Label "Laufwerksgröße" -BackgroundColor "#80962F23" -HoverBackgroundColor "#80962F23"
                    New-UdChartDataset -DataProperty "FreeSpace" -Label "Freier Speicher" -BackgroundColor "#8014558C" -HoverBackgroundColor "#8014558C"
					)
			}	
        }
    }
	
    New-UDRow -Columns {
        New-UDColumn -Size 6 -Content {
            New-UDMonitor -Title "CPU Last" -Type Line  -Endpoint {
				Get-Random -Minimum 0 -Maximum 100 | Out-UDMonitorData
				} -DataPointHistory 10 -RefreshInterval 2
        }
        New-UDColumn -Size 6 -Content {
                New-UDCounter -Title "Mails pro Sekunde" -AutoRefresh -RefreshInterval 3 -Endpoint {
					Get-Random -Minimum 0 -Maximum 1000 | ConvertTo-Json
				} -FontColor "black"
        }
    }
}

Start-UDDashboard -Dashboard $Dashboard -Port 10000

This is what the dashboard looks like in the browser (accessed via http://localhost:10000):

The colors and display can be customized as desired. PowerShell Universal Dashboards comes with a small web server that delivers the dashboards. If desired, IIS, Apache or NGINX can also be used.

In the Enterprise Edition, login pages and authorizations for dashboards can also be assigned.

An example page with code examples for the various options can be found here:

To get started, here is a YouTube video that explains the basics well:

Note: PowerShell Universal Dashboards is compatible with PowerShell Core and can therefore also be used on Linux and MacOS.

Exit mobile version