Script add - RAM status
This commit is contained in:
parent
a251ae9b90
commit
27dae05e1b
|
@ -125,6 +125,15 @@
|
|||
"shell": "powershell",
|
||||
"category": "TRMM (Win):Hardware"
|
||||
},
|
||||
{
|
||||
"guid": "ae231ac4-b01f-4a39-a9d2-3d817af75260",
|
||||
"filename": "Win_Hardware_RAM_Status.ps1",
|
||||
"submittedBy": "https://github.com/silversword411",
|
||||
"name": "RAM - Check Information",
|
||||
"description": "Retreives and reports on RAM info: DIMM's, total memory, slots total and used",
|
||||
"shell": "powershell",
|
||||
"category": "TRMM (Win):Hardware"
|
||||
},
|
||||
{
|
||||
"guid": "95a2ee6f-b89b-4551-856e-3081b041caa7",
|
||||
"filename": "Win_Reset_High_Performance_Power_Profile_to_Defaults.ps1",
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
#Identifies Computer RAM capacity and status
|
||||
|
||||
[Cmdletbinding()]
|
||||
Param(
|
||||
[string]$Computername = "localhost"
|
||||
)
|
||||
cls
|
||||
$PysicalMemory = Get-WmiObject -class "win32_physicalmemory" -namespace "root\CIMV2" -ComputerName $Computername
|
||||
|
||||
Write-Host "RAM Modules:" -ForegroundColor Green
|
||||
$PysicalMemory | Format-Table Tag, BankLabel, @{n = "Capacity(GB)"; e = { $_.Capacity / 1GB } }, Manufacturer, PartNumber, Speed -AutoSize
|
||||
|
||||
Write-Host "Total Memory:" -ForegroundColor Green
|
||||
Write-Host "$((($PysicalMemory).Capacity | Measure-Object -Sum).Sum/1GB)GB"
|
||||
|
||||
$TotalSlots = ((Get-WmiObject -Class "win32_PhysicalMemoryArray" -namespace "root\CIMV2" -ComputerName $Computername).MemoryDevices | Measure-Object -Sum).Sum
|
||||
Write-Host "`nTotal Memory Slots:" -ForegroundColor Green
|
||||
Write-Host $TotalSlots
|
||||
|
||||
$UsedSlots = (($PysicalMemory) | Measure-Object).Count
|
||||
Write-Host "`nUsed Memory Slots:" -ForegroundColor Green
|
||||
Write-Host $UsedSlots
|
||||
|
||||
If ($UsedSlots -eq $TotalSlots) {
|
||||
Write-Host "All memory slots are filled up, none is empty!" -ForegroundColor Yellow
|
||||
}
|
Loading…
Reference in New Issue