• Skip to primary navigation
  • Skip to main content
  • Skip to footer

Stephanos Constantinou Blog

PowerShell Scripting

  • Home
  • Blogs
    • PowerShell Tutorials
    • PowerShell Scripts
    • PowerShell Modules
      • Modules Cmdlets
    • Software Reviews
  • About
  • Contact
You are here: Home / PowerShell Modules / Modules Cmdlets / Get-DiskDrive

Get-DiskDrive

22/10/2018 by Stephanos Leave a Comment

Get-DiskDrive

Description

Get-DiskDrive will provide you the information of a physical disk drive as seen by a computer running Windows operating system.

Note: You need to install SysInfo module in order for this cmdlet to be available. For more information, see PowerShell Module SysInfo.

Syntax:

Get-DiskDrive
    [[-ComputerName] <String[]>]
    [[-Protocol] <String>]
    [[-Properties] <String[]>]
    [<CommonParameters>]

Requirements

  • SysInfo PowerShell Module
  • WinRM Enabled and PowerShell 3.0 (only if you use WinRM protocol)

If you want to find more about the specific cmdlet while you are in PowerShell you can use the below to get the help file.

Code:

Get-Help Get-DiskDrive

Output:

PowerShell Module SysInfo v1-1 - Get-Help - Get-DiskDrive

 

Now lets see few examples about Get-DiskDrive.

[adinserter name=”In Article”]

Examples

Example 1

This command gets the information from local system.

PS C:\> Get-DiskDrive

DeviceID   : \\.\PHYSICALDRIVE0
Caption    : KINGSTON SH103S3240G
Partitions : 1
Size       : 240054796800
Model      : KINGSTON SH103S3240G
SystemName : LOCALPC
DeviceID   : \\.\PHYSICALDRIVE1
Caption    : TOSHIBA DT01ACA100
Partitions : 1
Size       : 1000202273280
Model      : TOSHIBA DT01ACA100
SystemName : LOCALPC
DeviceID   : \\.\PHYSICALDRIVE3
Caption    : Generic- Multi-Card USB Device
Partitions : 0
Size       : 
Model      : Generic- Multi-Card USB Device
SystemName : LOCALPC
DeviceID   : \\.\PHYSICALDRIVE2
Caption    : KINGSTON SH103S3120G
Partitions : 1
Size       : 120031511040
Model      : KINGSTON SH103S3120G
SystemName : LOCALPC

Example 2

This command gets the information from Server1.

PS C:\> Get-DiskDrive -ComputerName Server1

DeviceID   : \\.\PHYSICALDRIVE0
Caption    : Microsoft Virtual Disk
Partitions : 3
Size       : 107372805120
Model      : Microsoft Virtual Disk
SystemName : Server1

Example 3

This command gets the information from remote system with IP 192.168.0.5.

PS C:\> Get-DiskDrive -ComputerName "192.168.0.5"

DeviceID   : \\.\PHYSICALDRIVE0
Caption    : Microsoft Virtual Disk
Partitions : 3
Size       : 107372805120
Model      : Microsoft Virtual Disk
SystemName : Server1

Example 4

This command gets the information from Server1, Server2 and Server3.

PS C:\> Get-DiskDrive -ComputerName Server1,Server2,Server3

DeviceID   : \\.\PHYSICALDRIVE0
Caption    : Microsoft Virtual Disk
Partitions : 3
Size       : 107372805120
Model      : Microsoft Virtual Disk
SystemName : Server1
DeviceID   : \\.\PHYSICALDRIVE0
Caption    : Virtual HD ATA Device
Partitions : 2
Size       : 85896599040
Model      : Virtual HD ATA Device
SystemName : Server2
DeviceID   : \\.\PHYSICALDRIVE0
Caption    : Virtual HD ATA Device
Partitions : 2
Size       : 107372805120
Model      : Virtual HD ATA Device
SystemName : Server3

Example 5

Get the information from multiple remote systems using IP addresses.

PS C:\> Get-DiskDrive -ComputerName Server1 -Properties Name,Status

Name               Status
----               ------
\\.\PHYSICALDRIVE0 OK

Example 6

This command gets the information from Server1 and will output all properties.

PS C:\> Get-DiskDrive -ComputerName Server1 -Properties *

Caption                     : Microsoft Virtual Disk
Description                 : Disk drive
InstallDate                 : 
Name                        : \\.\PHYSICALDRIVE0
Status                      : OK
Availability                : 
ConfigManagerErrorCode      : 
ConfigManagerUserConfig     : False
DeviceID                    : \\.\PHYSICALDRIVE0
ErrorCleared                : 
ErrorDescription            : 
LastErrorCode               : 
PowerManagementCapabilities : 
PowerManagementSupported    : 
StatusInfo                  : 
SystemName                  : Server1
Capabilities                : {3, 4}
CapabilityDescriptions      : {Random Access, Supports Writing}
CompressionMethod           : 
DefaultBlockSize            : 
ErrorMethodology            : 
MaxBlockSize                : 
MaxMediaSize                : 
MinBlockSize                : 
NeedsCleaning               : 
NumberOfMediaSupported      : 
BytesPerSector              : 512
FirmwareRevision            : 1.0 
Index                       : 0
InterfaceType               : SCSI
Manufacturer                : (Standard disk drives)
MediaLoaded                 : True
MediaType                   : Fixed hard disk media
Model                       : Microsoft Virtual Disk
Partitions                  : 3
SCSIBus                     : 0
SCSILogicalUnit             : 0
SCSIPort                    : 0
SCSITargetId                : 0
SectorsPerTrack             : 63
SerialNumber                : 
Signature                   : 
Size                        : 107372805120
TotalCylinders              : 13054
TotalHeads                  : 255
TotalSectors                : 209712510
TotalTracks                 : 3328770
TracksPerCylinder           : 255
SizeKB                      : 104856255
SizeMB                      : 102398.69
SizeGB                      : 100

Example 7

This command gets the information from Server1.

PS C:\> "Server1" | Get-DiskDrive

DeviceID   : \\.\PHYSICALDRIVE0
Caption    : Microsoft Virtual Disk
Partitions : 3
Size       : 107372805120
Model      : Microsoft Virtual Disk
SystemName : Server1

Example 8

This command gets the information from Server1 using DCOM protocol.

PS C:\> Get-DiskDrive -ComputerName Server1 -Protocol DCOM

DeviceID   : \\.\PHYSICALDRIVE0
Caption    : Microsoft Virtual Disk
Partitions : 3
Size       : 107372805120
Model      : Microsoft Virtual Disk
SystemName : Server1

[adinserter name=”In Article”]

Optional Parameters

  • -ComputerName 
    • Description: Specifies the computer names or IP Addresses of the systems that we want to get the information from.
    • Required: False
    • Position: 1
    • Default value: None
    • Accept pipeline input: True (ByValue)
    • Accept wildcard characters: False
  • -Protocol
    • Description: Specifies the protocol that will be used to get the information from the remote system.
    • Accepted Values: DCOM or WinRM
    • Required: False
    • Position: 2
    • Default value: None
    • Accept pipeline input: False
    • Accept wildcard characters: False
  • -Properties
    • Description: Specifies the object properties that appear in the display and the order in which they appear. Wildcards are permitted.
    • Required: False
    • Position: 3
    • Default value
    • Accept pipeline input: False
    • Accept wildcard characters: True

Inputs

System.Array.

Get-DiskDrive can accept a string value to determine the ComputerName parameter.

Outputs

System.Object.

Get-DiskDrive returns an object containing all the information that has been retrieved.

[adinserter name=”In Article”]

Related Links

  • Get-1394Controller
  • Get-BaseBoard
  • Get-Battery
  • Get-BIOS
  • Get-Bus
  • Get-CacheMemory
  • Get-CDROMDrive
  • Get-CompactDisc
  • Get-Desktop
  • Get-DesktopMonitor
  • Get-DiskPartition
  • Get-Fan
  • Get-FloppyController
  • Get-FloppyDrive
  • Get-GlidePoint
  • Get-HeatPipe
  • Get-IDEController
  • Get-InfraredDevice
  • Get-Keyboard
  • Get-LocalDisk
  • Get-LogicalDisk
  • Get-MemoryArray
  • Get-MemoryDevice
  • Get-MotherboardDevice
  • Get-Mouse
  • Get-NetworkAdapter
  • Get-NetworkAdapterConfiguration
  • Get-NetworkDrive
  • Get-OperatingSystem
  • Get-OpticalSensor
  • Get-PhysicalMemory
  • Get-PhysicalMemoryArray
  • Get-PointingDevice
  • Get-PortableBattery
  • Get-PrinterConfiguration
  • Get-PrinterInfo
  • Get-Processor
  • Get-RAMDisk
  • Get-Refrigeration
  • Get-RemovableDisk
  • Get-SCSIController
  • Get-SoundDevice
  • Get-SystemEnclosure
  • Get-TapeDrive
  • Get-TemperatureProbe
  • Get-TouchPad
  • Get-TouchScreen
  • Get-TrackBall
  • Get-TrackPoint
  • Get-USBController
  • Get-VideoController
  • Get-VoltageProbe
  • PowerShell Gallery | SysInfo
  • GitHub – SConstantinou/SysInfo
  • PowerShell Module SysInfo

[adinserter name=”Matched-Content”]

Summary
Get-DiskDrive
Article Name
Get-DiskDrive
Description
Get-DiskDrive. Here you will find information about Get-DiskDrive and its use. Stephanos Constantinou Blog - PowerShell Scripting
Author
Stephanos
Publisher Name
Stephanos Constantinou Blog
Publisher Logo
Stephanos Constantinou Blog

Filed Under: Modules Cmdlets Tagged With: Win32_DiskDrive

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Footer

Recent Posts

  • ICS Cube Product Review 26/04/2019
  • PowerShell Module SysInfo v1.2.0 15/03/2019
  • PowerShell Module SysInfo v1.1.2 13/11/2018
  • PowerShell Module SysInfo 24/10/2018
  • Get-VoltageProbe 24/10/2018
  • Get-VideoController 24/10/2018
  • Get-USBController 24/10/2018
  • Get-TrackPoint 24/10/2018
  • Get-TrackBall 24/10/2018
  • Get-TouchScreen 24/10/2018
Planet PowerShell

Categories

  • Modules Cmdlets (57)
  • PowerShell Modules (5)
  • PowerShell Scripts (38)
  • PowerShell Tutorials (35)
  • Software Reviews (2)

Archives

  • April 2019 (1)
  • March 2019 (1)
  • November 2018 (1)
  • October 2018 (56)
  • September 2018 (13)
  • August 2018 (9)
  • July 2018 (6)
  • June 2018 (8)
  • May 2018 (7)
  • April 2018 (9)
  • March 2018 (4)
  • February 2018 (6)
  • January 2018 (12)
  • December 2017 (4)
Top 10 PowerShell 2018

Blogroll

  • Planet PowerShell
  • Reddit – PowerShell
  • PowerShell Magazine
  • PowerShell.org
  • PowerShell Team Blog
  • Hey, Scripting Guy! Blog
  • Mike F Robbins
  • PowerShell Explained with Kevin Marquette
  • Mike Kanakos – Network Admin
  • The Lonely Administrator
  • AskME4Tech
PowerShell Blogs Sysadmin Blogs Banners for Top 20 Programming Blogs

© 2022 · Stephanos Constantinou Blog

  • Home
  • Blogs
  • About
  • Contact