Skip to content

Instantly share code, notes, and snippets.

@kort3x
Last active December 22, 2017 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kort3x/6da732987d4d91888cc23c0c025e9669 to your computer and use it in GitHub Desktop.
Save kort3x/6da732987d4d91888cc23c0c025e9669 to your computer and use it in GitHub Desktop.
$disks = Get-CimInstance -ClassName Win32_LogicalDisk
ForEach ($disk in ($disks | where Drivetype -EQ 3)) {
$Data = @(
@{Space="used";Count=([Math]::Round((($disk.Size / 1GB) - ($disk.FreeSpace / 1GB)), 2))}
@{Space="free";Count=([Math]::Round($disk.FreeSpace / 1GB, 2))}
)
New-UDColumn -Size 2 {
New-UDChart -Title "$($disk.DeviceID)" -Type Doughnut -Options @{cutoutPercentage = 0} -Endpoint {
$Data | Out-UDChartData -LabelProperty "Space" -Dataset @(New-UDLineChartDataset -Label "Disk" -DataProperty Count)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment