PowerShell: Check if Disk Is SSD or HDD

Need to know whether a drive is an SSD or a traditional HDD - for performance troubleshooting, upgrade planning, or confirming hardware specs? This one-liner pulls the media type straight from the system.

Prerequisites:

  • Privileges: None
  • Module: Built-in, no import needed

Quick Command:

Get-PhysicalDisk | Select-Object FriendlyName, MediaType

Example Output:

FriendlyName MediaType
------------ ---------
harddisk SSD SSD
📦
Want all of them at once?
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.

How It Works:

  • Get-PhysicalDisk queries physical disks through the newer Storage module, which reports more accurately on modern hardware than older CIM classes.
  • FriendlyName shows the disk's model/display name as reported by the drive itself.
  • MediaType returns SSD, HDD, or Unspecified - this value isn't stored directly on the disk, it's calculated behind the scenes by the Storage module based on other raw disk properties, which makes it far more reliable than older methods.

Why Not Just Check Win32_DiskDrive?

The older Win32_DiskDrive class has a MediaType property too, but it predates SSDs becoming mainstream - it almost always just returns "Fixed hard disk media" regardless of whether the drive is actually an SSD or HDD, so it can't reliably tell them apart. Get-PhysicalDisk is the modern replacement built specifically to report this correctly.