PS-Commands/Scripts/Get-MemorySlots.psm1

20 lines
722 B
PowerShell
Raw Normal View History

function Get-MemorySlots {
2024-01-29 23:41:19 +03:00
$Memory = Get-CimInstance Win32_PhysicalMemory |
Select-Object Manufacturer,
PartNumber,
ConfiguredClockSpeed,
@{Label="Memory"; Expression={[string]($_.Capacity/1Mb)}},
Tag,DeviceLocator,
BankLabel
$CollectionMemory = New-Object System.Collections.Generic.List[System.Object]
$Memory | ForEach-Object {
$CollectionMemory.Add([PSCustomObject]@{
Tag = $_.Tag
Model = [String]$_.ConfiguredClockSpeed+" Mhz "+$_.Manufacturer+" "+$_.PartNumber
Size = [string]($_.Memory)+" Mb"
Device = $_.DeviceLocator
Bank = $_.BankLabel
})
}
$CollectionMemory
}