How To Assess SSD Health in PowerShell

PowerShell can retrieve valuable information about the health of your solid-state disks. Use these commands to assess SSD health.

Brien Posey

December 6, 2022

4 Min Read
How To Assess SSD Health in PowerShell
Getty Images

In a separate article, I explained several GUI-based options that will determine whether your PC’s solid-state drive (SSD) is healthy. Here, I want focus on PowerShell commands that are useful for assessing an SSD’s health.

Select the Physical Disk in Question

The first thing to do is to point PowerShell toward the disk that you want to examine. Entering the Get-PhysicalDisk cmdlet will return a list of the system’s disks. If your computer only contains a single disk, then this alone is sufficient. However, if the system contains multiple disks, you will need to use the Where-Object cmdlet to select a specific disk.

In Figure 1, you can see that the Get-PhysicalDisk cmdlet revealed the presence of four disks. Each disk has a number associated with it. The SSD that I want to examine is disk 0. As such, the command used to look at that specific disk is this:

Get-PhysicalDisk | Where-Object {$_.DeviceID -eq 0}

You can see these commands in Figure 1.

PowerShell screenshot shows Get-PhysicalDisk cmdlet retrieves information about a disk

SSD Health 2-1_0

Figure 1. The Get-PhysicalDisk cmdlet retrieves information about a disk that is installed in the system.

Retrieve the Storage Reliability Counter

Once we have pointed PowerShell at a specific physical disk, the next cmdlet that is required is the Get-StorageReliabilityCounter cmdlet. As its name implies, the Get-StorageReliabilityCounter retrieves the Storage Reliability Counter. This counter is what makes it possible to examine a disk’s temperature and how much wear has taken place.

Related:How To Simplify PowerShell Storage Capacity Information

Here is the full command you will need to use (assuming that you are examining Disk 0):

Get-PhysicalDisk | Where-Object {$_.DeviceID -eq 0} | Get-StorageReliabilityCounter

While the command probably seems simple enough, there are a few things that you need to know. First, even though the Get-PhysicalDisk cmdlet will work in a standard PowerShell session, the Get-StorageReliabilityCounter cmdlet will only work in an elevated PowerShell session. If you try to run this cmdlet in a standard session, you will either receive a Permission Denied error or you will get a message that says, “Access to a CIM resource was not available to the client,” as shown in Figure 2. Again, the solution to this error is to use an elevated command prompt.

PowerShell screenshot shows Get-StorageReliabilityCounter cmdlet does not work in a standard PowerShell session

SSD Health 2-2_0

Figure 2. The Get-StorageReliabilityCounter cmdlet does not work in a standard PowerShell session.

The other issue that you may encounter is that when you run this command in an elevated PowerShell window, it fails to return any data. If you look at Figure 3, for example, you can see that the disk’s wear was reported as 0 and no data was given for temperature, uncorrected read errors, or number of hours powered on.

PowerShell screenshot shows Storage Reliability Counter appearing to not return any useful data

SSD Health 2-3_0

Figure 3. The Storage Reliability Counter initially appears not to return any useful data.

So, what’s going on here? Why does Windows not give us any SSD health data?

Believe it or not, the data shown in the figure above is considered normal. If you see non-zero values for wear or for read errors, it’s typically an indication that you might want to start thinking about replacing the drive.

If you want to confirm that the Storage Reliability Counter is indeed returning data, just enter the following command:

Get-PhysicalDisk | Where-Object {$_.DeviceID -eq 0} | Get-StorageReliabilityCounter | Select-Object *

This command will cause PowerShell to show all available Storage Reliability Counters for the disk. Depending on the type of disk that is installed in your system, some of these counters will likely be blank, but at the very least you should see some latency values. These values indicate that the counters are working, as shown in Figure 4.

PowerShell screenshot shows some of the available Storage Reliability Counter properties do contain data

SSD Health 2-4_0

Figure 4. Some of the available Storage Reliability Counter properties do contain data.

Missing Data

One last thing to note is that over the course of writing this article, I found an apparent bug in the Windows 11 version of the Get-StorageReliabilityCounter. As you saw in Figure 3, one of the columns that the Get-StorageReliabilityCounter cmdlet returns by default is Temperature. My Windows 11 machine showed the Temperature column as blank. However, when I typed Get-PhysicalDisk | Get-StorageReliabilityCounter | Select-Object Temperature, a value was returned. You can see what this looks like in Figure 5.

PowerShell screenshot shows disk’s temperature data

SSD Health 2-5

Figure 5. The disk’s temperature was not initially reported, but I was able to retrieve it manually.

The reason why I am mentioning this is to underscore the idea that if Windows initially fails to display data you would expect to see, you can try selecting the column individually. Doing so might cause Windows to display the missing data.

About the Author

Brien Posey

Brien Posey is a bestselling technology author, a speaker, and a 20X Microsoft MVP. In addition to his ongoing work in IT, Posey has spent the last several years training as a commercial astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space.

http://brienposey.com/

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like