Skip to content

Instantly share code, notes, and snippets.

@raulunzue
Created April 19, 2020 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raulunzue/596e421c672e4996b54a0915f5979c70 to your computer and use it in GitHub Desktop.
Save raulunzue/596e421c672e4996b54a0915f5979c70 to your computer and use it in GitHub Desktop.
Get-WMIObject  -Class Win32_LogicalDisk | Where-Object {$_.DriveType -eq 3}  `
| Select-Object @{n="Unidad";e={($_.Name)}},
@{n="Etiqueta";e={($_.VolumeName)}},
@{n='Tamaño (GB)';e={"{0:n2}" -f ($_.size/1gb)}},
@{n='Libre (GB)';e={"{0:n2}" -f ($_.freespace/1gb)}},
@{n='% Libre';e={"{0:n2}" -f ($_.freespace/$_.size*100)}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment