Asserts that an expected value is less than a given value.
Assert-LessThan [[-ExpectedValue] <Object>] [[-UpperBound] <Object>] [[-Message] <String>] [<CommonParameters>]
Uses PowerShell's -lt
operator to perform the check.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ExpectedValue | Object | The value to check. |
false | false | |
UpperBound | Object | The value to check against, i.e. the value |
false | false | |
Message | String | A message to show when the assertion fails. |
false | false |
Assert-LessThan 1 5
Demonstrates how check that 1 is less than 5, ie. 1 -lt 5
.
Assert-LessThan 5 1 'Uh-oh. Five is less than 1!'
Demonstrates how to include a custom message when the assertion fails.