Complete the code to define a Pester test block.
Describe 'MyFunction' { It 'should return true' { [1] } }
The Should command is used inside It blocks to assert expected results in Pester.
Complete the code to run all Pester tests in the current directory.
Invoke-Pester -[1] .The -Path parameter tells Invoke-Pester where to find test files.
Fix the error in the test assertion to check if a value equals 5.
$result = 5; $result | Should [1] 5
The correct Pester assertion to check equality is -Be.
Fill both blanks to create a test that checks if a string contains 'hello'.
Describe 'String tests' { It 'contains hello' { 'hello world' | Should [1] [2] } }
Use -Match to check if a string matches a pattern, and the pattern here is 'hello'.
Fill all three blanks to create a test that checks if a list has exactly 3 items.
Describe 'List tests' { It 'has 3 items' { $list = @(1,2,3); $list.[1] | Should [2] [3] } }
Use Count property to get number of items, then Should -Be 3 to assert the count.
