Private/Helper/Get-RAMFree.ps1

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


FUNCTION Get-RAMFree {
    <#
    .SYNOPSIS
    Retrieves the amount of free physical RAM in megabytes.
 
    .DESCRIPTION
    This function calculates and returns the amount of free physical RAM available on the system in megabytes.
 
    .PARAMETER None
 
    .EXAMPLE
    Get-RAMFree
 
    .NOTES
    The function uses the Get-CIMInstance cmdlet to query the Win32_OperatingSystem class for free physical memory.
    #>


    RETURN [math]::round((Get-CIMInstance Win32_OperatingSystem).FreePhysicalMemory / 1MB,2)
}