Should

noun

say it: “SHOOD” /ʃʊd/

Pester's check that compares the value your code gave with the value it should be, and fails the test when they differ.

What does Should do in Pester?

Should is the check inside a Pester test. Pipe it the value your code gave and say what it should be; a match passes the test, and anything else fails it with a message that shows both. -Be, -BeTrue and -Exist are some of its checks.

$total.Songs | Should -Be 2
# fails when it's 3: Expected 2, but got 3.

In a sentence

  • “Each test ends with a Should check.”
  • “Should -Be 3750 failed with Expected 3750, but got 62.”

Level: Freelancer · More PowerShell terms at this level

Updated