Vicky Gupta
Vicky Gupta

Reputation: 636

How to write a powershell script to know disk is basic or dynamic?

I have to check whether a given node contains any dynamic disk or not and get the list of dynamic disk using Power Shell script. I am not supposed to use diskpart command. Any other solutions other than diskpart will be appreciated.

Upvotes: 1

Views: 2750

Answers (2)

Michael Yuniverg
Michael Yuniverg

Reputation: 107

you may use also diskpart utility, which is easily scriptable (I worked with it in Python) the idea is that when you perform diskpart and then list disk, output will be like:

Disk ###  Status         Size     Free     Dyn  Gpt
--------  -------------  -------  -------  ---  ---

Disk 0 Online 476 GB 0 B *

So you'll see all dynamic disks marked with asterisk under "Dyn"

Upvotes: 0

Related Questions