Add modules from WinAPI

This commit is contained in:
Alex Kup 2023-12-19 00:06:14 +03:00 committed by GitHub
parent bbfdb5d61f
commit 27a1568d53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 9 deletions

View file

@ -3,14 +3,16 @@ function Get-LD {
Label="Value"; Expression={$_.DeviceID}}, @{Label="AllSize"; Expression={
([int]($_.Size/1Gb))}},@{Label="FreeSize"; Expression={
([int]($_.FreeSpace/1Gb))}}, @{Label="Free%"; Expression={
[string]([int]($_.FreeSpace/$_.Size*100))+" %"}}
[string]([int]($_.FreeSpace/$_.Size*100))+" %"}},FileSystem,VolumeName
$CollectionLD = New-Object System.Collections.Generic.List[System.Object]
$LogicalDisk | ForEach-Object {
$CollectionLD.Add([PSCustomObject]@{
Logical_Disk = $_.Value
AllSize = [string]$_.AllSize+" Gb"
FreeSize = [string]$_.FreeSize+" Gb"
Free = $_."Free%"
FileSystem = $_.FileSystem
VolumeName = $_.VolumeName
AllSize = [string]$_.AllSize+" Gb"
FreeSize = [string]$_.FreeSize+" Gb"
Free = $_."Free%"
})
}
$CollectionLD