Must¶
SYNOPSIS¶
Asserts the compliant state of the piped field. Exactly one operator per Must.
SYNTAX¶
Must [[-InputObject] <Object>] [[-Be] <Object>] [[-BeIn] <Object[]>] [[-BeLike] <Object>] [[-Match] <Object>] [[-MatchCase] <Object>] [[-ContainText] <Object>] [[-ContainKey] <Object>] [-Exist] [[-BeG
reaterThan] <Object>] [[-BeGreaterOrEqual] <Object>] [[-BeLessThan] <Object>] [[-BeLessOrEqual] <Object>] [-Not] [-IfPresent] [-Strict] [<CommonParameters>]
USED IN¶
When, Require, Each, AnyOf, AllOf, Count -Where
EXAMPLES¶
Example 1¶
Field publicNetworkAccess | Must -Be 'Disabled'
Example 2¶
Each networkAcls.ipRules[*] { Field value | Must -Not -Be '0.0.0.0/0' }
Example 3¶
Field minimumTlsVersion | Must -BeIn 'TLS1_2', 'TLS1_3' -IfPresent
PARAMETERS¶
-InputObject¶
What is tested: a Field, Tag, Element, Count or value, piped to Must.
Type: Object
Required: false
Position: 1
Accept pipeline input: true (ByValue)
-Be¶
Compliant when the value equals this. Emits equals; the violation is notEquals.
Type: Object
Required: false
Position: 2
Accept pipeline input: false
-BeIn¶
Compliant when the value is one of these. Emits in; the violation is notIn.
Type: Object[]
Required: false
Position: 3
Accept pipeline input: false
-BeLike¶
Compliant when the value matches this wildcard pattern, with at most one *. Emits like.
Type: Object
Required: false
Position: 4
Accept pipeline input: false
-Match¶
Compliant when the value matches this Azure match pattern (# a digit, ? a letter, . any character), ignoring case. Emits matchInsensitively.
Type: Object
Required: false
Position: 5
Accept pipeline input: false
-MatchCase¶
As -Match, but case-sensitive. Emits match.
Type: Object
Required: false
Position: 6
Accept pipeline input: false
-ContainText¶
Compliant when the value contains this text. Emits contains.
Type: Object
Required: false
Position: 7
Accept pipeline input: false
-ContainKey¶
Compliant when the value has this key, such as a tag name. Emits containsKey.
Type: Object
Required: false
Position: 8
Accept pipeline input: false
-Exist¶
Compliant when the value is present. Emits exists: true.
Type: SwitchParameter
Required: false
Position: named
Accept pipeline input: false
-BeGreaterThan¶
Compliant when the value is greater than this. Emits greater.
Type: Object
Required: false
Position: 9
Accept pipeline input: false
-BeGreaterOrEqual¶
Compliant when the value is greater than or equal to this. Emits greaterOrEquals.
Type: Object
Required: false
Position: 10
Accept pipeline input: false
-BeLessThan¶
Compliant when the value is less than this. Emits less.
Type: Object
Required: false
Position: 11
Accept pipeline input: false
-BeLessOrEqual¶
Compliant when the value is less than or equal to this. Emits lessOrEquals.
Type: Object
Required: false
Position: 12
Accept pipeline input: false
-Not¶
Inverts the operator.
Type: SwitchParameter
Required: false
Position: named
Accept pipeline input: false
-IfPresent¶
A missing field is compliant (top level only, ADR-0004).
Type: SwitchParameter
Required: false
Position: named
Accept pipeline input: false
-Strict¶
A missing element field is a violation (inside Each only, ADR-0004).
Type: SwitchParameter
Required: false
Position: named
Accept pipeline input: false