W2KSG: Physical Disk Drive Properties

Lets stick with WMI and jump forward to chapter 10 where we will concentrate on disks and the file system

Starting point is physical disks. The WMI class the logically named Win32_DiskDrive.  If you want to see all properties use

Get-WmiObject Win32_DiskDrive | select *

This display is a little odd as the information is put out in an apparently random order with the __ properties in the middle. However, if you want to reproduce the script in the book then we need to be a little more selective.

Listing 10.1

Get-WmiObject Win32_DiskDrive | select caption, deviceid,index, interfacetype, manufacturer, medialoaded, mediatype, model, name, partitions, pnpdeviceid, scsibus, scsilogicalunit, scsiport, scsitargetid, sectorspertrack, size, status, totalcylinders, totalheads, totalsectors, totaltracks, trackspercylinder

This follows the usual pattern of choosing the class in get-wmiobject and then selecting the properties we are interested in.

I will be posting these scripts for download soon.

 


Share this post :

 

Technorati Tags: ,

About these ads
This entry was posted in PowerShell and WMI. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s