diff --git a/tests/Maester/Entra/Test-ConditionalAccessBaseline.Tests.ps1 b/tests/Maester/Entra/Test-ConditionalAccessBaseline.Tests.ps1 index 028d7b63..07a0f8a0 100644 --- a/tests/Maester/Entra/Test-ConditionalAccessBaseline.Tests.ps1 +++ b/tests/Maester/Entra/Test-ConditionalAccessBaseline.Tests.ps1 @@ -62,7 +62,7 @@ It "MT.1036: All excluded objects should have a fallback include in another policy. See https://maester.dev/docs/tests/MT.1036" -Tag "MT.1036", "Warning" { Test-MtCaGap | Should -Be $true -Because "there is one ore more object excluded without an include fallback in another policy." } - Context "License utilization" { + Context "License utilization" -Tag "LicenseUtilization" { It "MT.1022: All users utilizing a P1 license should be licensed. See https://maester.dev/docs/tests/MT.1022" -Tag "MT.1022" { $LicenseReport = Test-MtCaLicenseUtilization -License "P1" $LicenseReport.TotalLicensesUtilized | Should -BeLessOrEqual $LicenseReport.EntitledLicenseCount -Because "this is the maximium number of user that can utilize a P1 license" @@ -81,6 +81,15 @@ Describe "Security Defaults" -Tag "CA", "Security", "All" { Add-MtTestResultDetail -SkippedBecause LicensedEntraIDPremium } else { $SecurityDefaults = Invoke-MtGraphRequest -RelativeUri "policies/identitySecurityDefaultsEnforcementPolicy" -ApiVersion beta | Select-Object -ExpandProperty isEnabled + + if ($SecurityDefaults -eq $true) { + $testResultMarkdown = "Well done. SecurityDefaults are On `n`n" + } else { + $testResultMarkdown = "SecurityDefaults are Off '$($SecurityDefaults)' `n`n" + } + $testDetailsMarkdown = "You should enable SecurityDefaults or configure Conditional Access." + Add-MtTestResultDetail -Description $testDetailsMarkdown -Result $testResultMarkdown + $SecurityDefaults | Should -Be $true -Because "Security Defaults are not enabled" } } diff --git a/website/docs/commands/Invoke-Maester.mdx b/website/docs/commands/Invoke-Maester.mdx index 17082ae7..4d553db9 100644 --- a/website/docs/commands/Invoke-Maester.mdx +++ b/website/docs/commands/Invoke-Maester.mdx @@ -125,6 +125,21 @@ Invoke-Maester -PesterConfiguration $configuration ``` +### EXAMPLE 12 + +```powershell +$exclude_tags1 = @('CA', 'App') # System.Array +$exclude_tags2 = @('MT.1028', 'MT.1024') # System.Array + +$exclude_tags_combined = $exclude_tags1 + $exclude_tags2 + +#Invoke-Maester -ExcludeTag $exclude_tags_combined -Verbose +Invoke-Maester -ExcludeTag $exclude_tags_combined +``` + +This combines two arrays of exclusion tags and runs the tests, excluding any tests with those tags. + + ## PARAMETERS ### -Path