Tuesday, 9 June 2015

Getting Disk space from Local system

If you want to get the list of disks and their use age use following script

get-wmiobject win32_logicaldisk -Filter "Drivetype=3" -ComputerName "localhost" | select systemName,deviceid,volumename,@{Name ="size(GB)";Expression={"{0:N1}" -f($_.size/1gb)}},
@{Name="Freespace(Gb)";Expression={"{0:N1}" -f($_.freespace/1gb)}} | Format-Table -AutoSize


Output will be

No comments:

Post a Comment

Powershell function to get theremote server IP details,Subnetmask,Gateway,DHCP Enabled status,DNS Servers,Wins and Macaddress

#Powershell function to get theremote server IP details,Subnetmask,Gateway,DHCP Enabled status,DNS Servers,Wins and Macaddress # use...