Skip to content

Instantly share code, notes, and snippets.

@SQLDBAWithABeard
Created September 30, 2018 07:13
Show Gist options
  • Save SQLDBAWithABeard/25c0305bcce47057a85f6bc12a9ec613 to your computer and use it in GitHub Desktop.
Save SQLDBAWithABeard/25c0305bcce47057a85f6bc12a9ec613 to your computer and use it in GitHub Desktop.
testiong examples code
$Function = 'Get-DbcCheck'
Describe "$Function" {
Context "Checking $Function Examples" {
$Examples = Get-Help $Function -Examples
foreach ($examplecode in $Examples.examples.example.Code) {
It "Example Code $examplecode should not throw" {
{$examplecode} | Should -Not -Throw
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment