Created
December 2, 2017 01:03
-
-
Save kort3x/4139c06286a7e2b722fd70dd2d7194fe to your computer and use it in GitHub Desktop.
creating pie charts for diskapce in universaldashbaord
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$disks = Get-WmiObject -ClassName Win32_LogicalDisk -ComputerName $Computername | |
ForEach ($disk in $disks) { | |
New-UDColumn -Size 3 { | |
New-UdChart -Title "Speicherplatz" -Type Doughnut -Endpoint { | |
[PSCustomObject]@{ | |
DeviceId = $disk.DeviceID; | |
Size = [Math]::Round($disk.Size / 1GB, 2); | |
FreeSpace = [Math]::Round($disk.FreeSpace / 1GB, 2); | |
} | Out-UDChartData -LabelProperty "DeviceID" -Dataset @( | |
New-UdChartDataset -DataProperty "Size" -Label "Size" -BackgroundColor "#80962F23" -HoverBackgroundColor "#80962F23" | |
New-UdChartDataset -DataProperty "FreeSpace" -Label "Free Space" -BackgroundColor "#84aa33" -HoverBackgroundColor "#8014558C" | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment