Assert-LessThan

Asserts that an expected value is less than a given value.

Syntax

Assert-LessThan [[-ExpectedValue] <Object>] [[-UpperBound] <Object>] [[-Message] <String>] [<CommonParameters>]

Description

Uses PowerShell's -lt operator to perform the check.

Parameters

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 ExpectedValue should be less than.

false false
Message String

A message to show when the assertion fails.

false false

EXAMPLE 1

Assert-LessThan 1 5

Demonstrates how check that 1 is less than 5, ie. 1 -lt 5.

EXAMPLE 2

Assert-LessThan 5 1 'Uh-oh. Five is less than 1!'

Demonstrates how to include a custom message when the assertion fails.