< Back

Assert-LessThan

Sun Jan 12, 2020 5:44 pm

NAME Assert-LessThan



SYNOPSIS

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

-ExpectedValue <Object>

The value to check.



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-UpperBound <Object>

The value to check against, i.e. the value `ExpectedValue` should be less than.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Message <String>

A message to show when the assertion fails.



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-LessThan 1 5



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









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Assert-LessThan 5 1 'Uh-oh. Five is less than 1!'



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











RELATED LINKS