Private/Helper/Get-RAMTotal.ps1

<#
Copyright © 2024 Integris. For internal company use only. All rights reserved.
#>


FUNCTION Get-RAMTotal {
    <#
    .SYNOPSIS
    Retrieves the total physical RAM in gigabytes.
 
    .DESCRIPTION
    This function calculates and returns the total amount of physical RAM installed on the system in gigabytes.
 
    .PARAMETER None
 
    .EXAMPLE
    Get-RAMTotal
 
    .NOTES
    The function uses the Get-CimInstance cmdlet to query physical memory and Measure-Object to sum the capacity.
    #>


    RETURN ((Get-CimInstance Win32_PhysicalMemory | Measure-Object -Property capacity -Sum).sum / 1gb)
}