Skip to content

Instantly share code, notes, and snippets.

@kbarnes3
Created April 7, 2024 22:28
Show Gist options
  • Select an option

  • Save kbarnes3/9b0114e4e491844a405a9b6d39afe464 to your computer and use it in GitHub Desktop.

Select an option

Save kbarnes3/9b0114e4e491844a405a9b6d39afe464 to your computer and use it in GitHub Desktop.

Revisions

  1. kbarnes3 created this gist Apr 7, 2024.
    13 changes: 13 additions & 0 deletions Get-DiskStats.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    Get-PhysicalDisk | Sort-Object -Property DeviceId | Format-Table DeviceId,
    FriendlyName,
    Model,
    @{Name="Size"; Expression={
    $size = $_.Size;
    $postfixes = @( "B", "KB", "MB", "GB", "TB", "PB" );
    for ($i=0; $size -ge 1024 -and $i -lt $postfixes.Length; $i++) { $size = $size / 1024; };
    return "" + [System.Math]::Round($size,2) + " " + $postfixes[$i];}},
    FirmwareVersion,
    SerialNumber,
    BusType,
    PhysicalLocation -Auto
    Get-PhysicalDisk | Get-StorageReliabilityCounter | Sort-Object DeviceId | ft DeviceId,*Laten*,Temp*,Power*,*Error*