Blogger is going to mangle whitespace again, but here goes... Yes, you can set up multiple Tags in Pester Describe blocks by passing arrays.
I should probably submit a pull for the Pester Wiki, just for fun (though not with this incredibly helpful code snippet. That'd be overkill).
By the way, am I the only person who sees a line like `Passed: 3 Failed: 0 Skipped: 0 Pending: 0` and often scans too quickly, seeing `3 Failed`? Wonder if `Passed: 3 - Failed: 0 - Skipped: 0 - Pending: 0` would be better. Otherwise, I'm liking 1.) Pester far too much, 2.) the time to write my PowerShell code with tests. Too many bugs found now that I'm doing TDD (okay, admittedly, here that's probably "Test Driven Debugging"), which is both good and depressing. ;^)

Describe -Tag "spam","ham" "testMe" {
    It "spam and ham" {
        $true | Should Be $true;
    }
}
Describe -Tag "spam" "testMe" {
    It "spam only" {
        $true | Should Be $true;
    }
}
Describe -Tag "ham" "testMe" {
    It "ham only" {
        $true | Should Be $true;
    }
}
------------------------------
PS> Invoke-Pester
Executing all tests in 'C:\something'
Describing testMe
[+] spam and ham 93ms
Describing testMe
[+] spam only 90ms
Describing testMe
[+] ham only 65ms

Tests completed in 249ms
Passed: 3 Failed: 0 Skipped: 0 Pending: 0

PS> Invoke-Pester -Tag "ham"
Executing all tests in 'C:\something'
Describing testMe
[+] spam and ham 137ms
Describing testMe
[+] ham only 66ms

Tests completed in 203ms
Passed: 2 Failed: 0 Skipped: 0 Pending: 0

PS> Invoke-Pester -Tag "spam"
Executing all tests in 'C:\something'
Describing testMe
[+] spam and ham 71ms
Describing testMe
[+] spam only 61ms

Tests completed in 132ms
Passed: 2 Failed: 0 Skipped: 0 Pending: 0

Labels: