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,23 @@
function Get-DiskPhysical {
$PhysicalDisk = Get-CimInstance Win32_DiskDrive |
Select-Object Model,
@{Label="Size"; Expression={[int]($_.Size/1Gb)}},
Partitions,
InterfaceType,
Status,
ConfigManagerErrorCode,
LastErrorCode
$CollectionPD = New-Object System.Collections.Generic.List[System.Object]
$PhysicalDisk | ForEach-Object {
$CollectionPD.Add([PSCustomObject]@{
Model = $_.Model
Size = [string]$_.Size+" Gb"
PartitionCount = $_.Partitions
Interface = $_.InterfaceType
Status = $_.Status
ConfigManagerErrorCode = $_.ConfigManagerErrorCode
LastErrorCode = $_.LastErrorCode
})
}
$CollectionPD
}