Get-PhysicalDisk (MSFT_PhysicalDisk) and Get-Disk (MSFT_Disk) OperationalStatus values

We've recently had an issue that values were missing from the OperationalStatus property of the MSFT_Disk WMI class documented here.

https://msdn.microsoft.com/en-us/library/windows/desktop/hh830493(v=vs.85).aspx

It seems that this list is missing a number of values.

You can see more values that are available with this PowerShell command
Get-PhysicalDisk|Get-Member -Name OperationalStatus | SELECT Definition -ExpandProperty Definition

This reveals the inner code that the cmdlet is using to provide a display value for the operational status. Here you can see a number of values that are not documented in the page above.

System.Object OperationalStatus {get=$_status = @();
          foreach ( $status in $this.psBase.CimInstanceProperties["OperationalStatus"].Value )
          {
            switch ( $status )
            {
              1 { $_status += "Other" }
              2 { $_status += "OK" }
              3 { $_status += "Degraded" }
              4 { $_status += "Stressed" }
              5 { $_status += "Predictive Failure" }
              6 { $_status += "Error" }
              7 { $_status += "Non-Recoverable Error" }
              8 { $_status += "Starting" }
              9 { $_status += "Stopping" }
              10 { $_status += "Stopped" }
              11 { $_status += "In Service" }
              12 { $_status += "No Contact" }
              13 { $_status += "Lost Communication" }
              14 { $_status += "Aborted" }
              15 { $_status += "Dormant" }
              16 { $_status += "Supporting Entity in Error" }
              17 { $_status += "Completed" }
              18 { $_status += "Power Mode" }
              19 { $_status += "Relocating" }
              53252 { $_status += "Failed Media" }
              53253 { $_status += "Split" }
              53254 { $_status += "Stale Metadata" }
              53255 { $_status += "IO Error" }
              53256 { $_status += "Unrecognized Metadata" }
              53269 { $_status += "Removing From Pool" }
              53270 { $_status += "In Maintenance Mode" }
              53271 { $_status += "Updating Firmware" }
              53272 { $_status += "Device Hardware Error" }
              53273 { $_status += "Not Usable" }
              53274 { $_status += "Transient Error" }
              53276 { $_status += "Starting Maintenance Mode"}
              53277 { $_status += "Stopping Maintenance Mode"}
              53285 { $_status += "Threshold Exceeded"}
              53286 { $_status += "Abnormal Latency"}
              Default { "Unknown" }
            }
          }
          $_status;;}

Comments

Popular posts from this blog

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Windows Server 2019 desktop icons such as My Computer, Windows cannot access the specified device, path, or file.