Created
April 7, 2024 22:28
-
-
Save kbarnes3/9b0114e4e491844a405a9b6d39afe464 to your computer and use it in GitHub Desktop.
Get-DiskStats.ps1
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
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* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment