From ca11271f42017b47712276d8a33199ce8291fa7e Mon Sep 17 00:00:00 2001 From: Brian Reid <31985319+brianreidc7@users.noreply.github.com> Date: Mon, 9 Feb 2026 18:03:50 +0000 Subject: [PATCH] Add tags and skip condition to test cases Skip condition on the Describe line causes the tags to be ignored. So when running the tests and this specific test is skipped because it is "LongRunning" but this tag is not shown in the results, so it is not clear why the test was skipped. Steps: Invoke-Maester, wait for results, filter by "Not Tested" and then find this test - it shows it was "Not Tested" (becuase LongRunning was not specified in Invoke-... but the Tags shown in the result do not show "LongRunning" so it is unclear why the test was skipped. Move the -Skip to the It line and copy the tags to the It line and you get a better result in Maester results page. --- tests/Maester/Entra/Test-ConditionalAccessWhatIf.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Maester/Entra/Test-ConditionalAccessWhatIf.Tests.ps1 b/tests/Maester/Entra/Test-ConditionalAccessWhatIf.Tests.ps1 index 26f0d16e1..468b6e321 100644 --- a/tests/Maester/Entra/Test-ConditionalAccessWhatIf.Tests.ps1 +++ b/tests/Maester/Entra/Test-ConditionalAccessWhatIf.Tests.ps1 @@ -17,11 +17,11 @@ BeforeDiscovery { } -Describe 'Maester/Entra' -Tag 'CA', 'CAWhatIf', 'LongRunning', 'Maester' -Skip:( $EntraIDPlan -eq 'Free' ) { +Describe 'Maester/Entra' -Tag 'CA', 'CAWhatIf', 'LongRunning', 'Maester' { Context 'Maester/Entra' -ForEach @( $RegularUsers ) { # Regular users - It "MT.1033.$($RegularUsers.IndexOf($_)): User should be blocked from using legacy authentication ($($_.userPrincipalName))" -Tag 'MT.1033' { + It "MT.1033.$($RegularUsers.IndexOf($_)): User should be blocked from using legacy authentication ($($_.userPrincipalName))" -Tag 'MT.1033', 'CA', 'CAWhatIf', 'LongRunning', 'Maester' -Skip:( $EntraIDPlan -eq 'Free' ) { Test-MtCaWIFBlockLegacyAuthentication -UserId $id | Should -Be $true }