1

For example if I wanted to assert the value should be Value1 or Value2 (either is acceptable):

   It 'Value must match Value1 or Value2' {
         $params.value | Should -be "Value1" || "Value2"
    }`

This is invalid syntax - is there a way to do this with Pester?

1 Answers1

6

You want the -BeIn assertion:

if 'Value must match Value1 or Value 2' {
    $params.Value |Should -BeIn @('Value1','Value2')
}
Mathias R. Jessen
  • 157,619
  • 12
  • 148
  • 206