Added modules from WinAPI

This commit is contained in:
Lifailon 2024-01-29 23:41:19 +03:00
parent 56da334ea2
commit b709d7e96b
24 changed files with 657 additions and 125 deletions

View file

@ -0,0 +1,13 @@
function Get-DiskPartition {
$PhysicalDisk = Get-CimInstance -Namespace root/Microsoft/Windows/Storage -ClassName MSFT_PhysicalDisk
$Partition = Get-CimInstance -Namespace root/Microsoft/Windows/Storage -ClassName MSFT_Partition |
Select-Object @{Label="Disk"; Expression={$PhysicalDisk | Where-Object DeviceId -eq $_.DiskNumber | Select-Object -ExpandProperty FriendlyName}},
IsBoot,
IsSystem,
IsHidden,
IsReadOnly,
IsShadowCopy,
@{Label="OffSet"; Expression={($_.OffSet/1Gb).ToString("0.00 Gb")}},
@{Label="Size"; Expression={($_.Size/1Gb).ToString("0.00 Gb")}}
$Partition | Sort-Object Disk,OffSet
}