YAML is a human-readable data-serialization language for structured configuration. It uses indentation to express nesting, making workflow definitions readable while requiring consistent spacing. section 14.2
In CI/CD automation, YAML defines when a workflow runs, which jobs execute, the operating system they use, and the steps that invoke shell commands. GitHub workflows and Azure DevOps Pipelines use it. section 14.2 section 14.2.1
A practical GitHub workflow organizes YAML around these elements:
- The name identifies the workflow. section 14.2.1
- The on key defines automatic triggers, such as opened or reopened pull requests. section 14.2.1
- Jobs define execution environments and can run concurrently or sequentially. section 14.2.1
- Steps check out repository code and run PowerShell commands, including Pester tests. section 14.2.1
Automated pull-request testing
Save a file such as Get-SystemInfo.yaml under .github/workflows/. Configure it to run on pull requests, use windows-latest, check out the repository, and invoke the Pester test file with pwsh. section 14.2.1
Listing 14.4 Get-SystemInfo.yaml
name: PoshAutomator Pester Tests
on:
pull_request: #1
types: [opened, reopened]
jobs:
pester-test:
name: Pester test
runs-on: windows-latest #2
steps:
- name: Check out repository code #3
uses: actions/checkout@v3
- name: Run the Get-SystemInfo.Unit.Test.ps1 Test File
shell: pwsh
run: | #4
Invoke-Pester .\Test\Get-SystemInfo.Test.ps1 -Passthru
Inspect the complete workflow listing to see indentation connect the trigger, job, runner, checkout action, shell, and test command. section 14.2.1















