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
RAM Booster for PC
harlan4096 — 10:23
RAM Booster for PC
Hello, Plz Sugges...alina104 — 09:34
Microsoft Retires Standalone SharePoint ...
Microsoft Is Ending...harlan4096 — 08:29
The Notepad++ supply chain attack — unno...
Introduction On...harlan4096 — 08:27
Adobe Acrobat Reader DC 2025.001.21151
Adobe Acrobat Reade...harlan4096 — 08:12

[-]
Birthdays
Today's Birthdays
avatar (49)zamokpluff
avatar (30)sarapelon21
avatar (51)FrankNub
Upcoming Birthdays
avatar (47)hapedDow
avatar (46)komriwat
avatar (48)Michaelecozy
avatar (38)showercurtains
avatar (49)PeterWhink
avatar (50)neuthrusBub
avatar (30)script6027529171
avatar (46)delsreehRob
avatar (44)pyotrded
avatar (41)oecmecodo
avatar (40)ShakitaSmobe
avatar (49)tsorenHievy
avatar (46)myhotseeve
avatar (46)Edwinmub
avatar (46)dimaWeami
avatar (41)svoyaEnuct
avatar (39)TranoTymn
avatar (39)MezirLal
avatar (50)listfquoto
avatar (46)dima6sarPrave
avatar (38)Michaelaburi
avatar (46)dpascoal
avatar (51)Ronaldduh
avatar (39)legalgauch
avatar (41)yposegij
avatar (44)Baihu
avatar (27)RaseinsLikes

[-]
Online Staff
harlan4096's profile harlan4096
Administrator

>