Skip to content

Retrieves basic memory information (a Windows PowerShell script).

License

Notifications You must be signed in to change notification settings

auberginehill/get-ram-info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Get-RAMInfo.ps1

OS: Windows
Type: A Windows PowerShell script
Language: Windows PowerShell
Description: Get-RAMInfo uses Windows Management Instrumentation (WMI) to retrieve basic memory information and displays the results in console.
Homepage: https://github.com/auberginehill/get-ram-info
Short URL: http://tinyurl.com/hdt9cet
Version: 1.1
Sources:
Emojis: Emoji Table
clayman2: Disk Space
Downloads: For instance Get-RAMInfo.ps1. Or everything as a .zip-file.

Screenshot

        screenshot

Outputs

➡️
  • Displays general memory information, such as used Memory Slots and Capacity, Speed, Manufacturer, Part Number, Type and Serial Number of individual Memory Modules and also Total number of Memory Slots in Use, Total Physical Memory and both Memory in Use and Available Memory as Size and as Percentage, Number of Processes running, Average CPU Load, Physical Memory in Use, C:-Drive Usage and Operating System Architecture in console.

Notes

⚠️
  • Please note that the optional file listed under Options-header will(, if the option is enabled by copy-pasting the relevant code above the [End of Line] -marker) be created in a directory, which is specified with the $path variable (at line 6).

  • The $env:temp variable points to the current temp folder. The default value of the $env:temp variable is C:\Users\<username>\AppData\Local\Temp (i.e. each user account has their own separate temp folder at path %USERPROFILE%\AppData\Local\Temp). To see the current temp path, for instance a command

    [System.IO.Path]::GetTempPath()

    may be used at the PowerShell prompt window [PS>]. To change the temp folder for instance to C:\Temp, please, for example, follow the instructions at Temporary Files Folder - Change Location in Windows, which in essence are something along the lines:
    1. Right click on Computer and click on Properties (or select Start → Control Panel → System). In the resulting window with the basic information about the computer...
    2. Click on Advanced system settings on the left panel and select Advanced tab on the resulting pop-up window.
    3. Click on the button near the bottom labeled Environment Variables.
    4. In the topmost section labeled User variables both TMP and TEMP may be seen. Each different login account is assigned its own temporary locations. These values can be changed by double clicking a value or by highlighting a value and selecting Edit. The specified path will be used by Windows and many other programs for temporary files. It's advisable to set the same value (a directory path) for both TMP and TEMP.
    5. Any running programs need to be restarted for the new values to take effect. In fact, probably also Windows itself needs to be restarted for it to begin using the new values for its own temporary files.

Examples

📖 To open this code in Windows PowerShell, for instance:

  1. ./Get-RAMInfo
    Run the script. Please notice to insert ./ or .\ before the script name.
  2. help ./Get-RAMInfo -Full
    Display the help file.
  3. Set-ExecutionPolicy remotesigned
    This command is altering the Windows PowerShell rights to enable script execution. Windows PowerShell has to be run with elevated rights (run as an administrator) to actually be able to change the script execution properties. The default value is "Set-ExecutionPolicy restricted".

    Parameters:

      Restricted Does not load configuration files or run scripts. Restricted is the default execution policy.
      AllSigned Requires that all scripts and configuration files be signed by a trusted publisher, including scripts that you write on the local computer.
      RemoteSigned Requires that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher.
      Unrestricted Loads all configuration files and runs all scripts. If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.
      Bypass Nothing is blocked and there are no warnings or prompts.
      Undefined Removes the currently assigned execution policy from the current scope. This parameter will not remove an execution policy that is set in a Group Policy scope.

    For more information, please type "help Set-ExecutionPolicy -Full" or visit Set-ExecutionPolicy.

  4. New-Item -ItemType File -Path C:\Temp\Get-RAMInfo.ps1
    Creates an empty ps1-file to the C:\Temp directory. The New-Item cmdlet has an inherent -NoClobber mode built into it, so that the procedure will halt, if overwriting (replacing the contents) of an existing file is about to happen. Overwriting a file with the New-Item cmdlet requires using the Force.
    For more information, please type "help New-Item -Full".

Contributing

Find a bug? Have a feature request? Here is how you can contribute to this project:

contributing Bugs: Submit bugs and help us verify fixes.
Feature Requests: Feature request can be submitted by creating an Issue.
Edit Source Files: Submit pull requests for bug fixes and features and discuss existing proposals.

www

www Script Homepage
clayman2: Disk Space
Getting RAM info - Powershell
Win32_PhysicalMemory class

Related scripts

www Firefox Customization Files
Get-AsciiTable
Get-BatteryInfo
Get-ComputerInfo
Get-DirectorySize
Get-InstalledPrograms
Get-InstalledWindowsUpdates
Get-TimeDifference
Get-TimeZoneTable
Get-UnusedDriveLetters
Emoji Table
Java-Update
Rock-Paper-Scissors
Toss-a-Coin
Update-AdobeFlashPlayer