Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- .SYNOPSIS
- This function sumarizes the properties of Get-WmiObject Win32_PhysicalMemory
- for those wanting to know what type of memory is needed for their PC.
- .DESCRIPTION
- This function sumarizes the properties of Get-WmiObject Win32_PhysicalMemory
- for those wanting to know what type of memory is needed for their PC.
- .OUTPUTS
- PSObject Collection. returns a collection custom objects with the following properties:
- Manufacturer - The manufacturer
- Capacity - Memory Capacity (bytes)
- Speed=RAM speed (nanoseconds)
- FormFactor=Form Factor (SODIMM,DIMM,etc.)
- MemoryType=Memory (DDR,SDRAM,etc.)
- .INPUTS
- System.Management.ManagementObject#root\cimv2\Win32_PhysicalMemory piped input
- .LINK
- Get-WmiObject
- .LINK
- http://msdn.microsoft.com/en-us/library/aa394347%28v=vs.85%29.aspx
- .EXAMPLE
- Get-WmiObject Win32_PhysicalMemory | Process-MemoryInfo
- FormFactor : SODIMM
- Manufacturer : Samsung
- MemoryType : DDR-2
- Capacity : 2147483648 bytes
- Speed : 800 nanoseconds
- FormFactor : SODIMM
- Manufacturer : Samsung
- MemoryType : DDR-2
- Capacity : 2147483648 bytes
- Speed : 800 nanoseconds
- #>
- function Process-MemoryInfo
- {
- begin {
- $memory_list = @()
- $form_factor = @(
- 'Unknown',
- 'Other',
- 'SIP',
- 'DIP',
- 'ZIP',
- 'SOJ',
- 'Proprietary',
- 'SIMM',
- 'DIMM',
- 'TSOP',
- 'PGA',
- 'RIMM',
- 'SODIMM',
- 'SRIMM',
- 'SMD',
- 'SSMP',
- 'QFP',
- 'TQFP',
- 'SOIC',
- 'LCC',
- 'PLCC',
- 'BGA',
- 'FPBGA',
- 'LGA'
- )
- $memory_type = @(
- 'Unknown',
- 'Other',
- 'DRAM',
- 'Synchronous DRAM',
- 'Cache DRAM',
- 'EDO',
- 'EDRAM',
- 'VRAM',
- 'SRAM',
- 'RAM',
- 'ROM',
- 'Flash',
- 'EEPROM',
- 'FEPROM',
- 'EPROM',
- 'CDRAM',
- '3DRAM',
- 'SDRAM',
- 'SGRAM',
- 'RDRAM',
- 'DDR',
- 'DDR-2'
- )
- }
- process {
- $memory_list += New-Object PSObject -Property @{
- Manufacturer=$_.Manufacturer;
- Capacity=[string]::Format("{0} bytes", $_.Capacity);
- Speed=[string]::Format("{0} nanoseconds", $_.Speed);
- FormFactor=$form_factor[$_.FormFactor];
- MemoryType=$memory_type[$_.MemoryType];
- }
- }
- end {
- return $memory_list
- }
- }
- function Get-MemoryInfo { Get-WmiObject Win32_PhysicalMemory | Process-MemoryInfo }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement