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 - 1; $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 - 1; $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 - 1; $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 - 1; $i++) { $size = $size / 1024; } return "" + [System.Math]::Round($size,2) + " " + $postfixes[$i]; Type VirtualDiskTableView Microsoft.Management.Infrastructure.CimInstance#MSFT_VirtualDisk FriendlyName ResiliencySettingName OperationalStatus HealthStatus IsManualAttach Right $size = $_.Size; $postfixes = @( "B", "KB", "MB", "GB", "TB", "PB" ) for ($i=0; $size -ge 1024 -and $i -lt $postfixes.Length - 1; $i++) { $size = $size / 1024; } return "" + [System.Math]::Round($size,2) + " " + $postfixes[$i]; StorageFaultDomainView Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageFaultDomain 24 14 ClassName FriendlyName PhysicalLocation HealthStatus OperationalStatus PhysicalDiskTableView Microsoft.Management.Infrastructure.CimInstance#MSFT_PhysicalDisk 9 14 14 10 FriendlyName SerialNumber 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 - 1; $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 StoragePoolTableView Microsoft.Management.Infrastructure.CimInstance#MSFT_StoragePool FriendlyName OperationalStatus HealthStatus IsPrimordial IsReadOnly 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 $_.PowerSupplyOperationalStatus ) { if ( ( $status -ne "OK" ) -and ( $status -ne "Not Installed" ) -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 "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 "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 "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 "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 "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 FileSystem DriveType HealthStatus OperationalStatus Right $size = $_.SizeRemaining; $postfixes = @( "B", "KB", "MB", "GB", "TB", "PB" ) for ($i=0; $size -ge 1024 -and $i -lt $postfixes.Length - 1; $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 - 1; $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 BytesProcessed BytesTotal FileIntegrityTableView Microsoft.Management.Infrastructure.CimInstance#MSFT_FileIntegrity FileName Enabled Enforced FileStorageTierTableView Microsoft.Management.Infrastructure.CimInstance#MSFT_FileStorageTier FilePath DesiredStorageTierName PlacementStatus State 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 PowerSupplyOperationalStatus FanOperationalStatus TemperatureSensorOperationalStatus VoltageSensorOperationalStatus CurrentSensorOperationalStatus IOControllerOperationalStatus StorageNode StorageEnclosure HealthActionTableView Microsoft.Management.Infrastructure.CimInstance#MSFT_HealthAction 18 25 true PercentComplete State 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 - 1; $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 - 1; $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 - 1; $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