-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path2.ps1
More file actions
17 lines (15 loc) · 813 Bytes
/
2.ps1
File metadata and controls
17 lines (15 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
param (
[Parameter(Mandatory = $false)]
[string] $ComputerName = 'localhost'
)
$drives = [System.IO.DriveInfo]::GetDrives() |
Where-Object {$_.TotalSize} |
Select-Object @{Name='Ordenador'; Expr={$ComputerName}},
@{Name='Nombre'; Expr={$_.Name}},
@{Name='Etiqueta'; Expr={$_.VolumeLabel}},
@{Name='Espacio(GB)'; Expr={[int32]($_.TotalSize / 1GB)}},
@{Name='Disponible(GB)'; Expr={[int32]($_.AvailableFreeSpace / 1GB)}},
@{Name='Espacio libre(%)'; Expr={[math]::Round($_.AvailableFreeSpace / $_.TotalSize,2)*100}},
@{Name='Formato'; Expr={$_.DriveFormat}},
@{Name='Tipo'; Expr={[string]$_.DriveType}}
$drives | ConvertTo-Json -Compress