Changed list-drives.ps1 to use Get-Volume

This commit is contained in:
Markus Fleschutz 2025-05-19 10:14:49 +02:00
parent 53345ebdcf
commit 6edf5cc843

View File

@ -6,9 +6,9 @@
.EXAMPLE
PS> ./list-drives.ps1
Name Root Used (GB) Free (GB)
---- ---- --------- ---------
C C:\ 6648,1 744,2
DriveLetter FriendlyName FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining Size
----------- ------------ -------------- --------- ------------ ----------------- ------------- ----
C SSD NTFS Fixed Healthy OK 449.65 GB 930.43 GB
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -16,9 +16,9 @@
#>
try {
Get-PSDrive -PSProvider FileSystem | format-table -property Name,Root,@{n="Used (GB)";e={[math]::Round($_.Used/1GB,1)}},@{n="Free (GB)";e={[math]::Round($_.Free/1GB,1)}}
Get-Volume
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
"⚠️ Error: $($Error[0])"
exit 1
}