Get Drive Size


posted by Ainab
11-06-2008

Downloads: 607
File size: 251 B
Views: 4,637

Embed
Get Drive Size
  1. $Drive = "C" #Specify the drive you want get its size 
  2. $DriveObject = new-object System.IO.DriveInfo $Drive 
  3. $DriveSize = ($DriveObject.TotalSize / 1024) / 1000 /1000 
  4. $DriveSize = [math]::Round($DriveSize, 2) 
  5. echo "The $Drive Drive is $DriveSize GB" 

Gets Drive size

Comments

kursatari wrote re: Get Drive Size
on 07-31-2012 2:12 AM

Hi,

I have a list.txt file it is about my windows servers ip. I want to list  its drive size and used size and free size how can i help me please

kursatari wrote re: Get Drive Size
on 07-31-2012 2:13 AM

sorry for my bad english. how can you help me please

Copyright 2012 PowerShell.com. All rights reserved.