Added modules from WinAPI
This commit is contained in:
parent
56da334ea2
commit
b709d7e96b
24 changed files with 657 additions and 125 deletions
23
Scripts/Get-DiskPhysical.psm1
Normal file
23
Scripts/Get-DiskPhysical.psm1
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue