Asserts that a value is greater than another object.
Assert-GreaterThan [[-InputObject] <Object>] [[-LowerBound] <Object>] [[-Message] <String>] [<CommonParameters>]
Uses PowerShell's -gt
operator to determine if $InputObject -gt $LowerBound
.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
InputObject | Object | The value to test. |
false | false | |
LowerBound | Object | The lower bound for |
false | false | |
Message | String | A description of why the assertion might fail. |
false | false |
Assert-GreaterThan 5 1
Demonstrates how to check if 5 is greater than 1, which it is, so this assertion passes.
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.