PowerShell Genie

Functions capstone: defend your automation

Quiz 3 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Six checks on everything the Functions journey taught: predict the output, spot the bug, judge pipeline claims, choose the fix, and verify it with Pester. One attempt per question.

0 of 6 answered · Pass mark: 5 of 6 · One attempt per question · Progress is saved in this browser.

  1. Question 1 of 6 — Predict the output

    function Get-Double { param([int]$n) $n * 2 } Get-Double -n 21

    What reaches the caller?

  2. Question 2 of 6 — Spot the bug

    This function returns two objects instead of one. Click the guilty line — one attempt.

    
    
    
    
    
    
  3. Question 3 of 6 — Judge the claims

    Which statements are true of a function that takes pipeline input? Select all that apply, then check.

  4. Question 4 of 6 — Choose the fix

    Get-DiskFreePercent returns two objects instead of one. Which change fixes it?

    Pick the fix you would defend in review.

  5. Question 5 of 6 — Predict the default

    function New-Greeting { param( [string]$Name = 'World' ) "Hello, $Name" } New-Greeting -Name 'Genie'

    What does this call output?

  6. Question 6 of 6 — Verify it

    Which Pester assertion proves Get-DiskFreePercent returns exactly one report object?

    Pick the assertion.

Genie guideFunctions capstone: defend your automation

Six checks on everything the Functions journey taught: predict the output, spot the bug, judge pipeline claims, choose the fix, and verify it with Pester. One attempt per question.