Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function MemoryMonitor() {
- clear-host;$slots=0;$arrays=0
- Get-WMIObject -Query "SELECT * FROM Win32_PhysicalMemoryArray WHERE Use=3" | Foreach {$slots += $_.MemoryDevices; $arrays += 1}
- $arrays2=Get-WMIObject Win32_PhysicalMemoryArray | Format-Table @{n='Total Memory Slots';e={$slots}},@{n='Memory Arrays';e={$arrays}}
- $aboutRAM=Get-WMIObject Win32_PhysicalMemory | Select-Object Caption,Description,@{n='Capacity';e={"$([math]::Round($_.Capacity/1GB)) GB"}},BankLabel,@{n='Device Locator';e={$_.DeviceLocator}},Manufacturer,@{n='Memory Type';e={switch($_.MemoryType){1{"Other"};2{"DRAM"};3{"Synchronus RAM"};4{"Cache RAM"};5{"EDO"};6{"EDRAM"};7{"VRAM"};8{"SRAM"};9{"RAM"};10{"ROM"};11{"Flash"};12{"EEPROM"};13{"FEPROM"};14{"EPROM"};15{"CDRAM"};16{"3DRAM"};17{"SDRAM"};18{"SGRAM"};19{"RDRAM"};20{"DDR"};21{"DDR2"};24{"DDR3"}}}},@{n='Form Factor';e={switch($_.FormFactor){1{"Other"};2{"SIP"};3{"DIP"};4{"ZIP"};5{"SOJ"};6{"Proprietary"};7{"SIMM"};8{"DIMM"};9{"TSOP"};10{"PGA"};11{"RIMM"};12{"SODIMM"};13{"SRIMM"};14{"SMD"};15{"SSMP"};16{"QFP"};17{"TQFP"};18{"SOIC"};19{"LCC"};20{"PLCC"};21{"BGA"};22{"FPBGA"};23{"LGA"}}}},Model,@{n='Speed';e={"$($_.Speed) MHz"}}
- "`n##########################################"
- "Slots and memory arrays"
- "##########################################"
- $arrays2
- "`n##########################################"
- "About your RAM"
- "##########################################"
- $aboutRAM
- "`n##########################################"
- "Real time usage info"
- "##########################################"
- $RUInfo=Get-WMIObject Win32_PerfFormattedData_PerfOS_Memory | Format-Table @{n='Free memory';e={"$($_.AvailableMBytes) MB"}},@{n='Used memory';e={"$([Math]::Round((Get-WMIObject Win32_PhysicalMemory | Select-Object -ExpandProperty Capacity)/1MB)-$_.AvailableMBytes) MB"}},@{n='Commit limit';e={"$([Math]::Round($_.CommitLimit/1MB)) MB"}},@{n='Committed memory';e={"$([Math]::Round($_.CommittedBytes/1MB)) MB"}},@{n='Paged pool';e={"$([Math]::Round($_.PoolPagedBytes/1MB)) MB"}},@{n='Non-paged pool';e={"$([Math]::Round($_.PoolNonpagedBytes/1MB)) MB"}}
- $RUInfo;"`n"
- $msg=@'
- 1) Pause
- 2) Go back
- 3) Immediate refresh
- Enter number
- '@
- choice /c 123 /n /m $msg /t 2 /d 3
- switch($LastExitCode){
- 1{cmd /c pause;MemoryMonitor}
- 2{$r}
- 3{MemoryMonitor}
- }
- }
- MemoryMonitor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement