mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-30 15:08:49 +02:00
Changed list-drives.ps1 to use Get-Volume
This commit is contained in:
parent
53345ebdcf
commit
6edf5cc843
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user