Look up hard disk information with PowerShell
#1
Lightbulb 
Quote:
[Image: display-disk-information-windows-powershell.png]

Windows PowerShell is quite powerful when it comes to looking up hard disk information. While you may look up some information in Windows directly, e.g. in Disk Management, or by using third-party programs like Hard Disk Validator, Disk Checkup, or DiskBoss, using PowerShell is a quick and easy option as well.

Hard disks are essential on Windows as they store operating system data and user data. The devices don't last forever, and a hard disk failure can easily lead to all sorts of issues including data loss if backups are not available (or corrupt).

PowerShell comes with several commands that return information about connected internal and external storage devices.

You may start a new PowerShell console by opening Start, typing Powershell, and selecting the item from the list of results. The commands don't require elevation to run.

Option 1: Retrieve general information

The command: get-wmiobject -class win32_logicaldisk

Run the command get-wmiobject -class win32_logicaldisk to look up core information about each connected hard drive. The command returns drive letters and types, the overall size and free space in bytes, and the volume name.

Drive type uses a numerical code:

0 -- Unknown
1 -- No Root directory
2 -- Removable Disk
3 -- Local Disk
4 -- Network Drive
5 -- Compact Disc
6 -- Ram Disk

You may use filters to display only select drive types, e.g. Get-WmiObject -Class Win32_logicaldisk -Filter "DriveType =4" to display network drives only.
Continue Reading
[-] The following 2 users say Thank You to harlan4096 for this post:
  • ismail, silversurfer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)
[-]
Welcome
You have to register before you can post on our site.

Username/Email:


Password:





[-]
Recent Posts
Mozilla Firefox Browser 148.0.2
Mozilla Firefox Br...harlan4096 — 10:28
QOwnNotes
26.3.6  Added a l...Kool — 10:28
AnyDesk Version 8.0.0 for Linux
AnyDesk Version 8....harlan4096 — 10:27
PrivaZer 4.0.119.1
PrivaZer 4.0.119.1...harlan4096 — 10:26
uBOLite 2026.308.1810 (already released ...
uBOLite 2026.308.1...harlan4096 — 10:26

[-]
Birthdays
Today's Birthdays
avatar (38)ykazawu
Upcoming Birthdays
avatar (44)gapedDow
avatar (38)snorydar
avatar (43)Hectorvot
avatar (51)knowhanPluts
avatar (39)Williamengiz
avatar (46)qaqapeti
avatar (44)battsourIonix
avatar (43)CedricSek
avatar (39)chasRex
avatar (33)uteluxix
avatar (47)piafcflene
avatar (39)Matthewkah
avatar (51)tersfargum
avatar (50)alfreExept
avatar (38)Charlesfibre
avatar (42)napasvem
avatar (44)diploJeoca
avatar (38)francisnj3
avatar (43)artmaGoork
avatar (41)RichardCisee

[-]
Online Staff
There are no staff members currently online.

>