external help file | Module Name | online version | schema |
---|---|---|---|
MemoryTools-help.xml |
MemoryTools |
2.0.0 |
Test if a computer meets a specific memory threshold.
Test-MemoryUsage [[-Computername] <String[]>] [-PercentFree <Int32>] [-Quiet] [<CommonParameters>]
Test-MemoryUsage [[-Computername] <String[]>] -UsedGB <Double> [-Quiet] [<CommonParameters>]
Test-MemoryUsage [[-Computername] <String[]>] -TotalGB <Int32> [-Quiet] [<CommonParameters>]
Test-MemoryUsage [[-Computername] <String[]>] -FreeGB <Double> [-Quiet] [<CommonParameters>]
Test-MemoryUsage -CimSession <CimSession[]> -UsedGB <Double> [-Quiet] [<CommonParameters>]
Test-MemoryUsage -CimSession <CimSession[]> -TotalGB <Int32> [-Quiet] [<CommonParameters>]
Test-MemoryUsage -CimSession <CimSession[]> -FreeGB <Double> [-Quiet] [<CommonParameters>]
Test-MemoryUsage -CimSession <CimSession[]> [-PercentFree <Int32>] [-Quiet] [<CommonParameters>]
This command can be used to test if memory utilization meets some criteria. There are several parameter sets for different tests. All of them can be used with -Quiet to return a simple Boolean value.
PS C:\> Test-MemoryUsage
Computername PctFree Test
------------ ------- ----
BOVINE320 50.53 True
Run the default test on the local computer. The default percentage threshold is 50%.
PS C:\> Test-MemoryUsage -FreeGB 16
Computername FreeGB Test
------------ ------ ----
BOVINE320 15.93 False
Test if the computer has at least 16GB of free memory.
PS C:\> Test-MemoryUsage -computername CHI-P50 -TotalGB 32 -Quiet
True
Test if the computer has at least 32GB of memory but only return True or False.
PS C:\> Test-MemoryUsage -UsedGB 20
Computername UsedGB Test
------------ ------ ----
BOVINE320 15.74 False
Test if the computer is using at least 20GB of memory.
Connect to an existing CimSession.
Type: CimSession[]
Parameter Sets: UsedCIM, TotalCIM, FreeCIM, PercentCIM
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Enter the name of a computer or computers to test.
Type: String[]
Parameter Sets: PercentComputer, UsedComputer, TotalComputer, FreeComputer
Aliases: cn
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Enter the minimum free memory in GB.
Type: Double
Parameter Sets: FreeComputer, FreeCIM
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Enter the minimum % free memory
Type: Int32
Parameter Sets: PercentComputer, PercentCIM
Aliases:
Required: False
Position: Named
Default value: 50
Accept pipeline input: False
Accept wildcard characters: False
Suppress details and return a Boolean value.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Enter the minimum total memory in GB
Type: Int32
Parameter Sets: TotalComputer, TotalCIM
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Enter the minimum amount of used memory in GB
Type: Double
Parameter Sets: UsedComputer, UsedCIM
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/