récupérer espace disque par partition
bonjour a tous
j'aurai besoin de récupérer Espace disque par partition
Code:
1 2 3 4 5 6 7
| Clear-Host
Get-WmiObject Win32_logicaldisk -ComputerName "localhost" `
| Format-Table DeviceID, MediaType, `
@{Name='Size(GB)';Expression={[decimal]('{0:N0}' -f($_.size/1gb))}}, `
@{Name='Free Space(GB)';Expression={[decimal]('{0:N0}' -f($_.freespace/1gb))}}, `
@{Name='Free (%)';Expression={'{0,6:P0}' -f(($_.freespace/1gb) / ($_.size/1gb))}} `
-AutoSize |
Si j’exécute ce petit script j'aurai comme résultat
DeviceID MediaType Size(GB) Free Space(GB) Free (%)
-------- --------- -------- -------------- --------
A: 5 0 0
C: 12 70 7 10 %
D: 12 245 45 18 %
R: 11 0 0
Sur mon serveur j'ai comme partition que celle DU c:\ et D:\ alors comment je peut enlever celle du A: et R:
merci pour vos aide