DeviceInformation
DeviceNumber :
DeviceNumber
DeviceGuid :
DeviceGuid
FriendlyName :
FriendlyName
SerialNumber :
SerialNumber
AdapterSerialNumber :
AdapterSerialNumber
FirmwareRevision :
FirmwareRevision
BusType :
BusType
MediaType :
MediaType
IoTimeout :
if ($_.IoTimeout -gt 0)
{
$_.IoTimeout.ToString() + " seconds"
}
else
{
"Not available"
}
StorageIoDistributionEvent
Event time:
$_.EventTime.ToString('yyyy/MM/dd HH:mm:00') + ", Total Success IO Count: " + [String]::Format('{0:N0}',$_.TotalSuccessCount)
DiskTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_Disk
6
32
20
20
12
10
Number
FriendlyName
SerialNumber
HealthStatus
OperationalStatus
Right
$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];
PartitionStyle
DiskListView
Microsoft.Management.Infrastructure.CimInstance#MSFT_Disk
UniqueId
Number
Path
Manufacturer
Model
SerialNumber
$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];
AllocatedSize
LogicalSectorSize
PhysicalSectorSize
NumberOfPartitions
PartitionStyle
IsReadOnly
IsSystem
IsBoot
PartitionTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_Partition
DiskId
16
11
10
PartitionNumber
DriveLetter
Offset
Right
$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];
Type
PartitionListView
Microsoft.Management.Infrastructure.CimInstance#MSFT_Partition
UniqueId
AccessPaths
DiskNumber
DiskPath
DriveLetter
Guid
IsActive
IsBoot
IsHidden
IsOffline
IsReadOnly
IsShadowCopy
IsDAX
IsSystem
NoDefaultDriveLetter
Offset
OperationalStatus
PartitionNumber
$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];
Type
VirtualDiskTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_VirtualDisk
FriendlyName
ResiliencySettingName
PhysicalDiskRedundancy
OperationalStatus
HealthStatus
Right
$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];
Right
$footprint = $_.FootprintOnPool;
$postfixes = @( "B", "KB", "MB", "GB", "TB", "PB" )
for ($i=0; $footprint -ge 1024 -and $i -lt $postfixes.Length; $i++) { $footprint = $footprint / 1024; }
return "" + [System.Math]::Round($footprint,2) + " " + $postfixes[$i];
Right
$efficiency = "";
if ($_.FootprintOnPool -gt 0) { $efficiency = ($_.AllocatedSize / $_.FootprintOnPool).ToString("P"); }
return $efficiency
StorageTierTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageTier
FriendlyName
TierClass
MediaType
ResiliencySettingName
PhysicalDiskRedundancy
Right
$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];
Right
$footprint = $_.FootprintOnPool;
$postfixes = @( "B ", "KB", "MB", "GB", "TB", "PB" )
for ($i=0; $footprint -ge 1024 -and $i -lt $postfixes.Length; $i++) { $footprint = $footprint / 1024; }
return "" + [System.Math]::Round($footprint,2) + " " + $postfixes[$i];
Right
$efficiency = "";
if ($_.FootprintOnPool -gt 0) { $efficiency = ($_.AllocatedSize / $_.FootprintOnPool).ToString("P"); }
return $efficiency
StorageFaultDomainView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageFaultDomain
24
14
return $_.ClassName.Replace('MSFT_', '');
FriendlyName
SerialNumber
PhysicalLocation
HealthStatus
OperationalStatus
PhysicalDiskTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_PhysicalDisk
9
14
14
10
DeviceId
FriendlyName
SerialNumber
MediaType
CanPool
OperationalStatus
HealthStatus
Usage
Right
$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];
AdvancedPhysicalDiskTableView
Microsoft.Windows.StorageManagement.PhysicalDiskAdvancedProperties
20
24
$_.PhysicalDisk.FriendlyName
$_.PhysicalDisk.SerialNumber
Right
IsPowerProtected
Right
IsDeviceCacheEnabled
StorageError_v1TableView
Microsoft.Windows.StorageManagement.StorageError_v1
DeviceGuid
DeviceInformation
Right
[DateTime]$datetime = $_.EventTime.ToString('yyyy/MM/dd HH:mm:00')
return $datetime.ToShortDateString()
Right
[DateTime]$datetime = $_.EventTime.ToString('yyyy/MM/dd HH:mm:00')
return $datetime.ToShortTimeString()
Right
return "0x" + [String]::Format('{0:x2}',$_.Command)
Right
return "0x" + [String]::Format('{0:x2}',$_.SrbStatus)
Right
return "0x" + [String]::Format('{0:x2}',$_.ScsiStatus)
Right
return "0x" + [String]::Format('{0:x2}',$_.SenseKey)
Right
return "0x" + [String]::Format('{0:x2}',$_.SenseCode)
Right
return "0x" + [String]::Format('{0:x2}',$_.SenseCodeQualifier)
Right
return [String]::Format('{0:N0}',$_.IoSize)
Right
return [String]::Format('{0:N0}',$_.LBA)
StorageHistory_v5TableView
Microsoft.Windows.StorageManagement.StorageHistory_v5
DeviceGuid
DeviceInformation
Right
[DateTime]$datetime = $_.EventTime.ToString('yyyy/MM/dd HH:00:00')
return $datetime.ToShortDateString()
Right
[DateTime]$datetime = $_.EventTime.ToString('yyyy/MM/dd HH:00:00')
return $datetime.ToShortTimeString()
Right
return [String]::Format('{0:N0}',$_.TotalIoCount)
Right
MaxOutstandingCount
Right
return [String]::Format('{0:N1}',$_.AvgIoLatency/10)
Right
return [String]::Format('{0:N1}',$_.MaxIoLatency/10)
StorageHistory_v11TableView
Microsoft.Windows.StorageManagement.StorageHistory_v11
DeviceGuid
DeviceInformation
Right
[DateTime]$datetime = $_.EventTime.ToString('yyyy/MM/dd HH:00:00')
return $datetime.ToShortDateString()
Right
[DateTime]$datetime = $_.EventTime.ToString('yyyy/MM/dd HH:00:00')
return $datetime.ToShortTimeString()
Right
return [String]::Format('{0:N0}',$_.TotalIoCount)
Right
return [String]::Format('{0:N0}',$_.FailedIoCount)
Right
MaxOutstandingCount
Right
return [String]::Format('{0:N1}',$_.AvgIoLatency/10)
Right
return [String]::Format('{0:N1}',$_.MaxIoLatency/10)
Right
return [String]::Format('{0:N0}',$_.TotalQueueIoCount)
Right
return [String]::Format('{0:N1}',$_.AvgQueueIoWaitTime/10)
Right
return [String]::Format('{0:N1}',$_.MaxQueueIoWaitTime/10)
Right
return [String]::Format('{0:N0}',$_.QueueIoWaitExceededTimeoutCount)
StorageHistoryAggregate_v5TableView
Microsoft.Windows.StorageManagement.StorageHistoryAggregate_v5
DeviceNumber
FriendlyName
SerialNumber
BusType
MediaType
Right
return [String]::Format('{0:N0}',$_.TotalIoCount)
Right
return [String]::Format('{0:N1}',$_.AvgIoLatency/10)
Right
return [String]::Format('{0:N1}',$_.MaxIoLatency/10)
Right
EventCount
Right
if ($_.BucketHighestLatencyCount[0] -gt 0)
{
return $_.BucketHighestLatencyCount[0]
}
Right
if ($_.BucketHighestLatencyCount[1] -gt 0)
{
return $_.BucketHighestLatencyCount[1]
}
Right
if ($_.BucketHighestLatencyCount[2] -gt 0)
{
return $_.BucketHighestLatencyCount[2]
}
Right
if ($_.BucketHighestLatencyCount[3] -gt 0)
{
return $_.BucketHighestLatencyCount[3]
}
Right
if ($_.BucketHighestLatencyCount[4] -gt 0)
{
return $_.BucketHighestLatencyCount[4]
}
StorageHistoryAggregate_v11TableView
Microsoft.Windows.StorageManagement.StorageHistoryAggregate_v11
DeviceNumber
FriendlyName
SerialNumber
BusType
MediaType
Right
return [String]::Format('{0:N0}',$_.TotalIoCount)
Right
return [String]::Format('{0:N0}',$_.FailedIoCount)
Right
return [String]::Format('{0:N0}',$_.TotalQueueIoCount)
Right
return [String]::Format('{0:N1}',$_.AvgIoLatency/10)
Right
return [String]::Format('{0:N1}',$_.MaxIoLatency/10)
Right
EventCount
Right
if ($_.BucketHighestLatencyCount[0] -gt 0)
{
return $_.BucketHighestLatencyCount[0]
}
Right
if ($_.BucketHighestLatencyCount[1] -gt 0)
{
return $_.BucketHighestLatencyCount[1]
}
Right
if ($_.BucketHighestLatencyCount[2] -gt 0)
{
return $_.BucketHighestLatencyCount[2]
}
Right
if ($_.BucketHighestLatencyCount[3] -gt 0)
{
return $_.BucketHighestLatencyCount[3]
}
Right
if ($_.BucketHighestLatencyCount[4] -gt 0)
{
return $_.BucketHighestLatencyCount[4]
}
Right
if ($_.BucketHighestLatencyCount[5] -gt 0)
{
return $_.BucketHighestLatencyCount[5]
}
Right
if ($_.BucketHighestLatencyCount[6] -gt 0)
{
return $_.BucketHighestLatencyCount[6]
}
Right
if ($_.BucketHighestLatencyCount[7] -gt 0)
{
return $_.BucketHighestLatencyCount[7]
}
Right
if ($_.BucketHighestLatencyCount[8] -gt 0)
{
return $_.BucketHighestLatencyCount[8]
}
Right
if ($_.BucketHighestLatencyCount[9] -gt 0)
{
return $_.BucketHighestLatencyCount[9]
}
Right
if ($_.BucketHighestLatencyCount[10] -gt 0)
{
return $_.BucketHighestLatencyCount[10]
}
Right
if ($_.BucketHighestLatencyCount[11] -gt 0)
{
return $_.BucketHighestLatencyCount[11]
}
StorageIoDistribution
Microsoft.Windows.StorageManagement.StorageIoDistribution
EventTime
StorageIoDistributionEvent
Left
Left
Left
Right
Right
Right
Right
Right
Right
Right
Right
Right
Right
Right
Right
if ($_.IoSize -eq "4K")
{
$_.IoType
}
$_.IoSize
[String]::Format('{0:N0}',$_.IoSizeSuccessCount)
[String]::Format('{0:N0}',$_.LatencySuccessCount1)
[String]::Format('{0:N0}',$_.LatencySuccessCount2)
[String]::Format('{0:N0}',$_.LatencySuccessCount3)
[String]::Format('{0:N0}',$_.LatencySuccessCount4)
[String]::Format('{0:N0}',$_.LatencySuccessCount5)
[String]::Format('{0:N0}',$_.LatencySuccessCount6)
[String]::Format('{0:N0}',$_.LatencySuccessCount7)
[String]::Format('{0:N0}',$_.LatencySuccessCount8)
[String]::Format('{0:N0}',$_.LatencySuccessCount9)
[String]::Format('{0:N0}',$_.LatencySuccessCount10)
[String]::Format('{0:N0}',$_.LatencySuccessCount11)
[String]::Format('{0:N0}',$_.LatencySuccessCount12)
StoragePoolTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StoragePool
FriendlyName
OperationalStatus
HealthStatus
IsPrimordial
IsReadOnly
Right
$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];
Right
$allocatedSize = $_.AllocatedSize;
$postfixes = @( "B", "KB", "MB", "GB", "TB", "PB" )
for ($i=0; $allocatedSize -ge 1024 -and $i -lt $postfixes.Length; $i++) { $allocatedSize = $allocatedSize / 1024; }
return "" + [System.Math]::Round($allocatedSize,2) + " " + $postfixes[$i];
ResiliencySettingTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_ResiliencySetting
StoragePoolFriendlyName
Name
NumberOfDataCopiesDefault
PhysicalDiskRedundancyDefault
NumberOfColumnsDefault
InterleaveDefault
NumberOfGroupsDefault
StorageEnclosureTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageEnclosure
13
14
FriendlyName
SerialNumber
OperationalStatus
HealthStatus
NumberOfSlots
$ElementTypesInError = @( );
foreach ( $status in $_.SlotOperationalStatus )
{
if ( ( $status -ne "OK" ) -and ( $status -ne "Not Installed" ) -and ( $status -ne "Off" ) -and ( $status -ne "No Access Allowed" ) -and ( $status -ne "Not Reported" ) )
{
$ElementTypesInError = $ElementTypesInError + "Slot";
break;
}
}
foreach ( $status in $_.PowerSupplyOperationalStatus )
{
if ( ( $status -ne "OK" ) -and ( $status -ne "Not Installed" ) -and ( $status -ne "Off" ) -and ( $status -ne "No Access Allowed" ) -and ( $status -ne "Not Reported" ) )
{
$ElementTypesInError = $ElementTypesInError + "PowerSupply";
break;
}
}
foreach ( $status in $_.FanOperationalStatus )
{
if ( ( $status -ne "OK" ) -and ( $status -ne "Not Installed" ) -and ( $status -ne "Off" ) -and ( $status -ne "No Access Allowed" ) -and ( $status -ne "Not Reported" ) )
{
$ElementTypesInError = $ElementTypesInError + "Fan";
break;
}
}
foreach ( $status in $_.TemperatureSensorOperationalStatus )
{
if ( ( $status -ne "OK" ) -and ( $status -ne "Not Installed" ) -and ( $status -ne "Off" ) -and ( $status -ne "No Access Allowed" ) -and ( $status -ne "Not Reported" ) )
{
$ElementTypesInError = $ElementTypesInError + "TemperatureSensor";
break;
}
}
foreach ( $status in $_.VoltageSensorOperationalStatus )
{
if ( ( $status -ne "OK" ) -and ( $status -ne "Not Installed" ) -and ( $status -ne "Off" ) -and ( $status -ne "No Access Allowed" ) -and ( $status -ne "Not Reported" ) )
{
$ElementTypesInError = $ElementTypesInError + "VoltageSensor";
break;
}
}
foreach ( $status in $_.CurrentSensorOperationalStatus )
{
if ( ( $status -ne "OK" ) -and ( $status -ne "Not Installed" ) -and ( $status -ne "Off" ) -and ( $status -ne "No Access Allowed" ) -and ( $status -ne "Not Reported" ) )
{
$ElementTypesInError = $ElementTypesInError + "CurrentSensor";
break;
}
}
foreach ( $status in $_.IOControllerOperationalStatus )
{
if ( ( $status -ne "OK" ) -and ( $status -ne "Not Installed" ) -and ( $status -ne "Off" ) -and ( $status -ne "No Access Allowed" ) -and ( $status -ne "Not Reported" ) )
{
$ElementTypesInError = $ElementTypesInError + "IOController";
break;
}
}
return $ElementTypesInError;
StorageProviderTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageProvider
7
Type
Name
Manufacturer
StorageProviderListView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageProvider
UniqueId
Name
Manufacturer
Version
StorageProviderWideView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageProvider
Name
StorageSubSystemTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageSubSystem
FriendlyName
HealthStatus
OperationalStatus
StorageNodeTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageNode
Name
Manufacturer
Model
SerialNumber
OperationalStatus
VolumeTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_Volume
DriveLetter
FileSystemLabel
FileSystemType
DriveType
HealthStatus
OperationalStatus
Right
$size = $_.SizeRemaining;
$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];
Right
$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];
InitiatorPortTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_InitiatorPort
InstanceName
NodeAddress
PortAddress
ConnectionType
InitiatorIdTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_InitiatorId
InitiatorAddress
Type
HostType
TargetPortTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_TargetPort
FriendlyName
NodeAddress
PortAddress
ConnectionType
HealthStatus
OperationalStatus
TargetPortalTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_TargetPortal
IPv4Address
IPv6Address
PortNumber
SubnetMask
MaskingSetTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_MaskingSet
FriendlyName
HostType
StorageJobTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageJob
Name
IsBackgroundTask
ElapsedTime
JobState
PercentComplete
Right
$bytesProcessed = $_.BytesProcessed;
$postfixes = @( "B", "KB", "MB", "GB", "TB", "PB" )
for ($i=0; $bytesProcessed -ge 1024 -and $i -lt $postfixes.Length; $i++) { $bytesProcessed = $bytesProcessed / 1024; }
return "" + [System.Math]::Round($bytesProcessed,2) + " " + $postfixes[$i];
Right
$bytesTotal = $_.BytesTotal;
$postfixes = @( "B", "KB", "MB", "GB", "TB", "PB" )
for ($i=0; $bytesTotal -ge 1024 -and $i -lt $postfixes.Length; $i++) { $bytesTotal = $bytesTotal / 1024; }
return "" + [System.Math]::Round($bytesTotal,2) + " " + $postfixes[$i];
FileIntegrityTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_FileIntegrity
FileName
Enabled
Enforced
FileStorageTierTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_FileStorageTier
FilePath
FileSize
DesiredStorageTierClass
FileSizeOnPerformanceTierClass
FileSizeOnCapacityTierClass
PlacementStatus
State
"{0:P}" -f ($_.FileSizeOnDesiredStorageTierClass / $_.FileSize);
StorageNodeToDisk
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageNodeToDisk
StorageNodeObjectId
DiskNumber
HealthStatus
OperationalStatus
IsReadOnly
IsOffline
OfflineReason
StorageNode
Disk
FileServerTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_FileServer
FriendlyName
HealthStatus
OperationalStatus
FileShareTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_FileShare
Name
HealthStatus
OperationalStatus
StorageReliabilityCounterTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageReliabilityCounter
DeviceId
if( $_.Temperature )
{
$_str += $_.Temperature;
$_str += " C"
}
return $_str
ReadErrorsUncorrected
Wear
PowerOnHours
StorageNodeToPhysicalDisk
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageNodeToPhysicalDisk
StorageNodeObjectId
DiskNumber
IsPhysicallyConnected
HealthStatus
OperationalStatus
IsMpioEnabled
LoadBalancePolicy
PathId
PathState
StorageNode
PhysicalDisk
StorageNodeToStorageEnclosure
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageNodeToStorageEnclosure
StorageNodeObjectId
EnclosureNumber
IsPhysicallyConnected
HealthStatus
SlotOperationalStatus
PowerSupplyOperationalStatus
FanOperationalStatus
TemperatureSensorOperationalStatus
VoltageSensorOperationalStatus
CurrentSensorOperationalStatus
IOControllerOperationalStatus
StorageNode
StorageEnclosure
HealthActionTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_HealthAction
18
25
25
true
PercentComplete
State
StartTime
Reason
StorageDiagnoseResultListView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageDiagnoseResult
PerceivedSeverity
Reason
$($_.RecommendedActions -join "`r`n")
FaultingObjectLocation
FaultingObjectDescription
StorageDiagnoseResultTableView
Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageDiagnoseResult
PerceivedSeverity
true
Reason
FaultingObjectDescription
StorageDiagnoseResultTableView
Microsoft.Management.Infrastructure.CimMethodStreamedResult#MSFT_StorageHealth#GetReport
true
true
$postfixes = @( "B", "KB", "MB", "GB", "TB", "PB" )
$bytesPerSecond = @( "B/S", "KB/S", "MB/S", "GB/S", "TB/S", "PB/S" )
$Seconds = @( "min", "s", "ms", "us","ns" )
$nameLength = 0
$valueLength = 0
$values = @()
$postFx = @()
foreach($r in $_.ItemValue.Records)
{
if ($r.Name.Length -gt $nameLength)
{
$nameLength = $r.Name.Length
}
$localValue=""
switch($r.Units)
{
0{
$size = $r.Value;
for ($i=0; $size -ge 1024 -and $i -lt $postfixes.Length; $i++) { $size = $size / 1024; }
$localValue = "{0}" -f [System.Math]::Round($size,2)
$values += $localValue
$postfx += $postfixes[$i];
}
1{
$size = $r.Value;
for ($i=0; $size -ge 1024 -and $i -lt $bytesPerSecond.Length; $i++) { $size = $size / 1024; }
$localValue = "{0}" -f [System.Math]::Round($size,2)
$values += $localValue
$postfx += $bytesPerSecond[$i];
}
2{
$localValue = "{0}" -f [System.Math]::Round($r.Value,2)
$values += $localValue
$postfx += "/S";
}
3{
$size = $r.Value;
$i = 1
if ($size -lt 1)
{
for($i = 1; $size -le 1 -and $i -lt $Seconds.Length; $i++ ) { $size = $size * 1000; }
}
else
{
if($size -gt 60)
{
$size = $size / 60
$i--
}
}
$localValue = "{0}" -f [System.Math]::Round($size,2)
$values += $localValue
$postfx += $Seconds[$i];
}
4{
$localValue = "{0}" -f [System.Math]::Round($r.Value,2)
$values += $localValue
$postfx += "%";
}
default
{
$values += $r.Value
$postfx += "";
}
}
if($localValue.Length -gt $valueLength)
{
$valueLength = $localValue.Length
}
}
$j=0;
foreach($r in $_.ItemValue.Records)
{
$s = "{0,-$nameLength} : {1,$valueLength} {2}" -f @($r.Name, $values[$j], $postfx[$j] )
Write-host $s
$j++
}
write-host ""
Microsoft.Management.Infrastructure.CimInstance#MSFT_HealthRecord
Microsoft.Management.Infrastructure.CimInstance#MSFT_HealthRecordUInt64
Microsoft.Management.Infrastructure.CimInstance#MSFT_HealthRecordReal64
Both