< Back
Assert-GreaterThan
Post
NAME Assert-GreaterThan
SYNOPSIS
Asserts that a value is greater than another object.
SYNTAX
Assert-GreaterThan [[-InputObject] <Object>] [[-LowerBound] <Object>] [[-Message] <String>] [<CommonParameters>]
DESCRIPTION
Uses PowerShell's `-gt` operator to determine if `$InputObject -gt $LowerBound`.
PARAMETERS
-InputObject <Object>
The value to test.
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-LowerBound <Object>
The lower bound for `InputObject`.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Message <String>
A description of why the assertion might fail.
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Assert-GreaterThan 5 1
Demonstrates how to check if 5 is greater than 1, which it is, so this assertion passes.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Assert-GreaterThan $Error.Count 5 'Not enough errors were thrown.'
Demonstrates how to use the message parameter to give an explanation of why the assertion fails.
RELATED LINKS
SYNOPSIS
Asserts that a value is greater than another object.
SYNTAX
Assert-GreaterThan [[-InputObject] <Object>] [[-LowerBound] <Object>] [[-Message] <String>] [<CommonParameters>]
DESCRIPTION
Uses PowerShell's `-gt` operator to determine if `$InputObject -gt $LowerBound`.
PARAMETERS
-InputObject <Object>
The value to test.
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-LowerBound <Object>
The lower bound for `InputObject`.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Message <String>
A description of why the assertion might fail.
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Assert-GreaterThan 5 1
Demonstrates how to check if 5 is greater than 1, which it is, so this assertion passes.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Assert-GreaterThan $Error.Count 5 'Not enough errors were thrown.'
Demonstrates how to use the message parameter to give an explanation of why the assertion fails.
RELATED LINKS