diff --git a/source/Private/Get-ExoOutput.ps1 b/source/Private/Get-CISExoOutput.ps1 similarity index 99% rename from source/Private/Get-ExoOutput.ps1 rename to source/Private/Get-CISExoOutput.ps1 index 98af176..e932c47 100644 --- a/source/Private/Get-ExoOutput.ps1 +++ b/source/Private/Get-CISExoOutput.ps1 @@ -4,11 +4,11 @@ .DESCRIPTION This sample function is not exported to the module and only return the data passed as parameter. .EXAMPLE - $null = Get-ExoOutput -PrivateData 'NOTHING TO SEE HERE' + $null = Get-CISExoOutput -PrivateData 'NOTHING TO SEE HERE' .PARAMETER PrivateData The PrivateData parameter is what will be returned without transformation. #> -function Get-ExoOutput { +function Get-CISExoOutput { [cmdletBinding()] [OutputType([string])] param( @@ -293,5 +293,5 @@ function Get-ExoOutput { end { Write-Verbose "Retuning data for Rec: $Rec" } -} # end function Get-MgOutput +} # end function Get-CISExoOutput diff --git a/source/Private/Get-CISMSTeamsOutput.ps1 b/source/Private/Get-CISMSTeamsOutput.ps1 new file mode 100644 index 0000000..70c28a6 --- /dev/null +++ b/source/Private/Get-CISMSTeamsOutput.ps1 @@ -0,0 +1,32 @@ +function Get-CISMSTeamsOutput +{ + <# + .SYNOPSIS + This is a sample Private function only visible within the module. + + .DESCRIPTION + This sample function is not exported to the module and only return the data passed as parameter. + + .EXAMPLE + $null = Get-MSTeamsOutput -PrivateData 'NOTHING TO SEE HERE' + + .PARAMETER PrivateData + The PrivateData parameter is what will be returned without transformation. + + #> + [cmdletBinding()] + [OutputType([string])] + param + ( + [Parameter()] + [String] + $PrivateData + ) + + process + { + Write-Output $PrivateData + } + +} + diff --git a/source/Private/Get-MgOutput.ps1 b/source/Private/Get-CISMgOutput.ps1 similarity index 96% rename from source/Private/Get-MgOutput.ps1 rename to source/Private/Get-CISMgOutput.ps1 index b578883..46e987e 100644 --- a/source/Private/Get-MgOutput.ps1 +++ b/source/Private/Get-CISMgOutput.ps1 @@ -1,4 +1,4 @@ -function Get-MgOutput { +function Get-CISMgOutput { <# .SYNOPSIS This is a sample Private function only visible within the module. @@ -7,7 +7,7 @@ function Get-MgOutput { This sample function is not exported to the module and only return the data passed as parameter. .EXAMPLE - $null = Get-MgOutput -PrivateData 'NOTHING TO SEE HERE' + $null = Get-CISMgOutput -PrivateData 'NOTHING TO SEE HERE' .PARAMETER PrivateData The PrivateData parameter is what will be returned without transformation. @@ -81,5 +81,5 @@ function Get-MgOutput { end { Write-Verbose "Retuning data for Rec: $Rec" } -} # end function Get-MgOutput +} # end function Get-CISMgOutput diff --git a/source/tests/Test-AdministrativeAccountCompliance.ps1 b/source/tests/Test-AdministrativeAccountCompliance.ps1 index cf0d390..2f205f8 100644 --- a/source/tests/Test-AdministrativeAccountCompliance.ps1 +++ b/source/tests/Test-AdministrativeAccountCompliance.ps1 @@ -17,7 +17,7 @@ function Test-AdministrativeAccountCompliance { try { # Retrieve admin roles, assignments, and user details including licenses Write-Verbose "Retrieving admin roles, assignments, and user details including licenses" - $adminRoleAssignments = Get-MgOutput -Rec $recnum + $adminRoleAssignments = Get-CISMgOutput -Rec $recnum $adminRoleUsers = @() diff --git a/source/tests/Test-AntiPhishingPolicy.ps1 b/source/tests/Test-AntiPhishingPolicy.ps1 index 843bc12..41bcb26 100644 --- a/source/tests/Test-AntiPhishingPolicy.ps1 +++ b/source/tests/Test-AntiPhishingPolicy.ps1 @@ -34,7 +34,7 @@ function Test-AntiPhishingPolicy { try { # Condition A: Ensure that an anti-phishing policy has been created - $antiPhishPolicies = Get-ExoOutput -Rec $recnum + $antiPhishPolicies = Get-CISExoOutput -Rec $recnum # Condition B: Verify the anti-phishing policy settings using PowerShell $validatedPolicies = $antiPhishPolicies | Where-Object { diff --git a/source/tests/Test-AuditDisabledFalse.ps1 b/source/tests/Test-AuditDisabledFalse.ps1 index edd7f11..0aa3de6 100644 --- a/source/tests/Test-AuditDisabledFalse.ps1 +++ b/source/tests/Test-AuditDisabledFalse.ps1 @@ -35,7 +35,7 @@ function Test-AuditDisabledFalse { # 6.1.1 (L1) Ensure 'AuditDisabled' organizationally is set to 'False' # Retrieve the AuditDisabled configuration (Condition B) - $auditNotDisabled = Get-ExoOutput -Rec $recnum + $auditNotDisabled = Get-CISExoOutput -Rec $recnum # Prepare failure reasons and details based on compliance $failureReasons = if (-not $auditNotDisabled) { diff --git a/source/tests/Test-AuditLogSearch.ps1 b/source/tests/Test-AuditLogSearch.ps1 index 578138b..5180b6c 100644 --- a/source/tests/Test-AuditLogSearch.ps1 +++ b/source/tests/Test-AuditLogSearch.ps1 @@ -36,7 +36,7 @@ function Test-AuditLogSearch { try { # 3.1.1 (L1) Ensure Microsoft 365 audit log search is Enabled - $auditLogResult = Get-ExoOutput -Rec $recnum + $auditLogResult = Get-CISExoOutput -Rec $recnum # Prepare failure reasons and details based on compliance $failureReasons = if (-not $auditLogResult) { diff --git a/source/tests/Test-BlockMailForwarding.ps1 b/source/tests/Test-BlockMailForwarding.ps1 index d9de8f6..a46b641 100644 --- a/source/tests/Test-BlockMailForwarding.ps1 +++ b/source/tests/Test-BlockMailForwarding.ps1 @@ -35,7 +35,7 @@ function Test-BlockMailForwarding { # 6.2.1 (L1) Ensure all forms of mail forwarding are blocked and/or disabled # Step 1: Retrieve the transport rules that redirect messages - $transportRules,$nonCompliantSpamPolicies = Get-ExoOutput -Rec $recnum + $transportRules,$nonCompliantSpamPolicies = Get-CISExoOutput -Rec $recnum $transportForwardingBlocked = $transportRules.Count -eq 0 # Step 2: Check all anti-spam outbound policies diff --git a/source/tests/Test-BlockSharedMailboxSignIn.ps1 b/source/tests/Test-BlockSharedMailboxSignIn.ps1 index a304952..9025358 100644 --- a/source/tests/Test-BlockSharedMailboxSignIn.ps1 +++ b/source/tests/Test-BlockSharedMailboxSignIn.ps1 @@ -30,7 +30,7 @@ function Test-BlockSharedMailboxSignIn { process { try { # Step: Retrieve shared mailbox details - $MBX = Get-ExoOutput -Rec $recnum + $MBX = Get-CISExoOutput -Rec $recnum # Step: Retrieve details of shared mailboxes from Azure AD (Condition B: Pass/Fail) $sharedMailboxDetails = $MBX | ForEach-Object { Get-AzureADUser -ObjectId $_.ExternalDirectoryObjectId } diff --git a/source/tests/Test-CommonAttachmentFilter.ps1 b/source/tests/Test-CommonAttachmentFilter.ps1 index 0840121..978f3ca 100644 --- a/source/tests/Test-CommonAttachmentFilter.ps1 +++ b/source/tests/Test-CommonAttachmentFilter.ps1 @@ -38,7 +38,7 @@ function Test-CommonAttachmentFilter { # Condition B: Using Exchange Online PowerShell, verify that the `EnableFileFilter` property of the default malware filter policy is set to `True`. # Retrieve the attachment filter policy - $result = Get-ExoOutput -Rec $recnum + $result = Get-CISExoOutput -Rec $recnum # Prepare failure reasons and details based on compliance $failureReasons = if (-not $result) { diff --git a/source/tests/Test-CustomerLockbox.ps1 b/source/tests/Test-CustomerLockbox.ps1 index 3796fbd..559caaf 100644 --- a/source/tests/Test-CustomerLockbox.ps1 +++ b/source/tests/Test-CustomerLockbox.ps1 @@ -33,7 +33,7 @@ function Test-CustomerLockbox { process { try { # Step: Retrieve the organization configuration (Condition C: Pass/Fail) - $customerLockboxEnabled = Get-ExoOutput -Rec $recnum + $customerLockboxEnabled = Get-CISExoOutput -Rec $recnum # Step: Prepare failure reasons and details based on compliance (Condition A, B, & C: Fail) $failureReasons = if (-not $customerLockboxEnabled) { diff --git a/source/tests/Test-EnableDKIM.ps1 b/source/tests/Test-EnableDKIM.ps1 index 7c55c4a..8b8a758 100644 --- a/source/tests/Test-EnableDKIM.ps1 +++ b/source/tests/Test-EnableDKIM.ps1 @@ -36,7 +36,7 @@ function Test-EnableDKIM { # 2.1.9 (L1) Ensure DKIM is enabled for all Exchange Online Domains # Retrieve DKIM configuration for all domains - $dkimConfig = Get-ExoOutput -Rec $recnum + $dkimConfig = Get-CISExoOutput -Rec $recnum $dkimResult = ($dkimConfig | ForEach-Object { $_.Enabled }) -notcontains $false $dkimFailedDomains = $dkimConfig | Where-Object { -not $_.Enabled } | ForEach-Object { $_.Domain } diff --git a/source/tests/Test-ExternalSharingCalendars.ps1 b/source/tests/Test-ExternalSharingCalendars.ps1 index df487f0..d2ae686 100644 --- a/source/tests/Test-ExternalSharingCalendars.ps1 +++ b/source/tests/Test-ExternalSharingCalendars.ps1 @@ -31,7 +31,7 @@ function Test-ExternalSharingCalendars { process { try { # Step: Retrieve sharing policies related to calendar sharing - $sharingPolicies = Get-ExoOutput -Rec $recnum + $sharingPolicies = Get-CISExoOutput -Rec $recnum # Step (Condition A & B: Pass/Fail): Check if calendar sharing is disabled in all applicable policies $isExternalSharingDisabled = $true diff --git a/source/tests/Test-GlobalAdminsCount.ps1 b/source/tests/Test-GlobalAdminsCount.ps1 index e52117a..8b5580c 100644 --- a/source/tests/Test-GlobalAdminsCount.ps1 +++ b/source/tests/Test-GlobalAdminsCount.ps1 @@ -30,7 +30,7 @@ function Test-GlobalAdminsCount { process { try { - $globalAdmins = Get-MgOutput -Rec $recnum + $globalAdmins = Get-CISMgOutput -Rec $recnum # Step: Count the number of global admins $globalAdminCount = $globalAdmins.Count diff --git a/source/tests/Test-IdentifyExternalEmail.ps1 b/source/tests/Test-IdentifyExternalEmail.ps1 index b8920ec..ebca9fd 100644 --- a/source/tests/Test-IdentifyExternalEmail.ps1 +++ b/source/tests/Test-IdentifyExternalEmail.ps1 @@ -36,7 +36,7 @@ function Test-IdentifyExternalEmail { # 6.2.3 (L1) Ensure email from external senders is identified # Retrieve external sender tagging configuration - $externalInOutlook = Get-ExoOutput -Rec $recnum + $externalInOutlook = Get-CISExoOutput -Rec $recnum $externalTaggingEnabled = ($externalInOutlook | ForEach-Object { $_.Enabled }) -contains $true # Prepare failure reasons and details based on compliance diff --git a/source/tests/Test-MailTipsEnabled.ps1 b/source/tests/Test-MailTipsEnabled.ps1 index 94197c0..c51f7ba 100644 --- a/source/tests/Test-MailTipsEnabled.ps1 +++ b/source/tests/Test-MailTipsEnabled.ps1 @@ -38,7 +38,7 @@ function Test-MailTipsEnabled { # 6.5.2 (L2) Ensure MailTips are enabled for end users # Retrieve organization configuration for MailTips settings - $orgConfig = Get-ExoOutput -Rec $recnum + $orgConfig = Get-CISExoOutput -Rec $recnum # Check the MailTips settings (Conditions A, B, C, D) $allTipsEnabled = $orgConfig.MailTipsAllTipsEnabled -and $orgConfig.MailTipsGroupMetricsEnabled -and $orgConfig.MailTipsLargeAudienceThreshold -eq 25 diff --git a/source/tests/Test-MailboxAuditingE3.ps1 b/source/tests/Test-MailboxAuditingE3.ps1 index ba8198c..d05c18c 100644 --- a/source/tests/Test-MailboxAuditingE3.ps1 +++ b/source/tests/Test-MailboxAuditingE3.ps1 @@ -38,14 +38,14 @@ function Test-MailboxAuditingE3 { $allFailures = @() $recnum = "6.1.2" - $allUsers = Get-MgOutput -Rec $recnum + $allUsers = Get-CISMgOutput -Rec $recnum $processedUsers = @{} # Dictionary to track processed users } process { if ($null -ne $allUsers) { - $mailboxes = Get-ExoOutput -Rec $recnum + $mailboxes = Get-CISExoOutput -Rec $recnum try { foreach ($user in $allUsers) { if ($processedUsers.ContainsKey($user.UserPrincipalName)) { diff --git a/source/tests/Test-MailboxAuditingE5.ps1 b/source/tests/Test-MailboxAuditingE5.ps1 index 6c218e0..f0ee6be 100644 --- a/source/tests/Test-MailboxAuditingE5.ps1 +++ b/source/tests/Test-MailboxAuditingE5.ps1 @@ -35,12 +35,12 @@ function Test-MailboxAuditingE5 { $allFailures = @() $processedUsers = @{} $recnum = "6.1.3" - $allUsers = Get-MgOutput -Rec $recnum + $allUsers = Get-CISMgOutput -Rec $recnum } process { if ($null -ne $allUsers) { - $mailboxes = Get-ExoOutput -Rec $recnum + $mailboxes = Get-CISExoOutput -Rec $recnum try { foreach ($user in $allUsers) { if ($processedUsers.ContainsKey($user.UserPrincipalName)) { diff --git a/source/tests/Test-ManagedApprovedPublicGroups.ps1 b/source/tests/Test-ManagedApprovedPublicGroups.ps1 index 0563ed5..2c2140f 100644 --- a/source/tests/Test-ManagedApprovedPublicGroups.ps1 +++ b/source/tests/Test-ManagedApprovedPublicGroups.ps1 @@ -30,7 +30,7 @@ function Test-ManagedApprovedPublicGroups { process { try { # Step: Retrieve all groups with visibility set to 'Public' - $allGroups = Get-MgOutput -Rec $recnum + $allGroups = Get-CISMgOutput -Rec $recnum # Step: Determine failure reasons based on the presence of public groups $failureReasons = if ($null -ne $allGroups -and $allGroups.Count -gt 0) { diff --git a/source/tests/Test-ModernAuthExchangeOnline.ps1 b/source/tests/Test-ModernAuthExchangeOnline.ps1 index f9bac64..d4f4738 100644 --- a/source/tests/Test-ModernAuthExchangeOnline.ps1 +++ b/source/tests/Test-ModernAuthExchangeOnline.ps1 @@ -34,7 +34,7 @@ function Test-ModernAuthExchangeOnline { # 6.5.1 (L1) Ensure modern authentication for Exchange Online is enabled # Check modern authentication setting in Exchange Online configuration (Condition A and B) - $orgConfig = Get-ExoOutput -Rec $recnum + $orgConfig = Get-CISExoOutput -Rec $recnum # Prepare failure reasons and details based on compliance $failureReasons = if (-not $orgConfig.OAuth2ClientProfileEnabled) { diff --git a/source/tests/Test-NoWhitelistDomains.ps1 b/source/tests/Test-NoWhitelistDomains.ps1 index 37441bb..076b2c1 100644 --- a/source/tests/Test-NoWhitelistDomains.ps1 +++ b/source/tests/Test-NoWhitelistDomains.ps1 @@ -38,7 +38,7 @@ function Test-NoWhitelistDomains { # Retrieve transport rules that whitelist specific domains # Condition A: Checking for transport rules that whitelist specific domains - $whitelistedRules = Get-ExoOutput -Rec $recnum + $whitelistedRules = Get-CISExoOutput -Rec $recnum # Prepare failure reasons and details based on compliance # Condition B: Prepare failure reasons based on the presence of whitelisted rules $failureReasons = if ($whitelistedRules) { diff --git a/source/tests/Test-NotifyMalwareInternal.ps1 b/source/tests/Test-NotifyMalwareInternal.ps1 index f2a17f3..d08da4f 100644 --- a/source/tests/Test-NotifyMalwareInternal.ps1 +++ b/source/tests/Test-NotifyMalwareInternal.ps1 @@ -34,7 +34,7 @@ function Test-NotifyMalwareInternal { # 2.1.3 Ensure notifications for internal users sending malware is Enabled # Retrieve all 'Custom' malware filter policies and check notification settings - $malwareNotifications = Get-ExoOutput -Rec $recnum + $malwareNotifications = Get-CISExoOutput -Rec $recnum # Condition B: Using PowerShell, the `NotifyInternal` property in the anti-malware policy is set to `True` and includes at least one valid email address for notifications. $policiesToReport = @() diff --git a/source/tests/Test-PasswordHashSync.ps1 b/source/tests/Test-PasswordHashSync.ps1 index 8c1e1b1..c054cfb 100644 --- a/source/tests/Test-PasswordHashSync.ps1 +++ b/source/tests/Test-PasswordHashSync.ps1 @@ -34,7 +34,7 @@ function Test-PasswordHashSync { # 5.1.8.1 (L1) Ensure password hash sync is enabled for hybrid deployments # Retrieve password hash sync status (Condition A and C) - $passwordHashSync = Get-MgOutput -Rec $recnum + $passwordHashSync = Get-CISMgOutput -Rec $recnum $hashSyncResult = $passwordHashSync # Prepare failure reasons and details based on compliance diff --git a/source/tests/Test-ReportSecurityInTeams.ps1 b/source/tests/Test-ReportSecurityInTeams.ps1 index 1b27dd7..94de4c6 100644 --- a/source/tests/Test-ReportSecurityInTeams.ps1 +++ b/source/tests/Test-ReportSecurityInTeams.ps1 @@ -24,7 +24,7 @@ function Test-ReportSecurityInTeams { $CsTeamsMessagingPolicy = Get-CsTeamsMessagingPolicy -Identity Global | Select-Object -Property AllowSecurityEndUserReporting # Condition B: Verify that 'Monitor reported messages in Microsoft Teams' is checked in the Microsoft 365 Defender portal. # Condition C: Ensure the 'Send reported messages to' setting in the Microsoft 365 Defender portal is set to 'My reporting mailbox only' with the correct report email addresses. - $ReportSubmissionPolicy = Get-ExoOutput -Rec $recnum + $ReportSubmissionPolicy = Get-CISExoOutput -Rec $recnum # Check if all the required settings are enabled $securityReportEnabled = $CsTeamsMessagingPolicy.AllowSecurityEndUserReporting -and $ReportSubmissionPolicy.ReportJunkToCustomizedAddress -and diff --git a/source/tests/Test-RestrictOutlookAddins.ps1 b/source/tests/Test-RestrictOutlookAddins.ps1 index a4537ca..8c5408e 100644 --- a/source/tests/Test-RestrictOutlookAddins.ps1 +++ b/source/tests/Test-RestrictOutlookAddins.ps1 @@ -36,7 +36,7 @@ function Test-RestrictOutlookAddins { # Check all mailboxes for custom policies with unallowed add-ins # Check Default Role Assignment Policy - $customPolicyFailures, $defaultPolicy = Get-ExoOutput -Rec $recnum + $customPolicyFailures, $defaultPolicy = Get-CISExoOutput -Rec $recnum $defaultPolicyRoles = $defaultPolicy.AssignedRoles | Where-Object { $_ -in $relevantRoles } # Condition A: Verify that the roles MyCustomApps, MyMarketplaceApps, and MyReadWriteMailboxApps are unchecked under Other roles. diff --git a/source/tests/Test-RestrictStorageProvidersOutlook.ps1 b/source/tests/Test-RestrictStorageProvidersOutlook.ps1 index a5f310a..a466f72 100644 --- a/source/tests/Test-RestrictStorageProvidersOutlook.ps1 +++ b/source/tests/Test-RestrictStorageProvidersOutlook.ps1 @@ -34,7 +34,7 @@ function Test-RestrictStorageProvidersOutlook { # 6.5.3 (L2) Ensure additional storage providers are restricted in Outlook on the web # Retrieve all OwaMailbox policies - $owaPolicies = Get-ExoOutput -Rec $recnum + $owaPolicies = Get-CISExoOutput -Rec $recnum # Condition A: Check if AdditionalStorageProvidersAvailable is set to False $nonCompliantPolicies = $owaPolicies | Where-Object { $_.AdditionalStorageProvidersAvailable } diff --git a/source/tests/Test-RestrictTenantCreation.ps1 b/source/tests/Test-RestrictTenantCreation.ps1 index c1a7c4e..476eb99 100644 --- a/source/tests/Test-RestrictTenantCreation.ps1 +++ b/source/tests/Test-RestrictTenantCreation.ps1 @@ -35,7 +35,7 @@ function Test-RestrictTenantCreation { # 5.1.2.3 (L1) Ensure 'Restrict non-admin users from creating tenants' is set to 'Yes' # Retrieve the tenant creation policy - $tenantCreationPolicy = Get-MgOutput -Rec $recnum + $tenantCreationPolicy = Get-CISMgOutput -Rec $recnum $tenantCreationResult = -not $tenantCreationPolicy.AllowedToCreateTenants # Prepare failure reasons and details based on compliance diff --git a/source/tests/Test-SafeAttachmentsPolicy.ps1 b/source/tests/Test-SafeAttachmentsPolicy.ps1 index fa22622..6011aa8 100644 --- a/source/tests/Test-SafeAttachmentsPolicy.ps1 +++ b/source/tests/Test-SafeAttachmentsPolicy.ps1 @@ -28,7 +28,7 @@ function Test-SafeAttachmentsPolicy { } process { - $safeAttachmentPolicies = Get-ExoOutput -Rec $recnum + $safeAttachmentPolicies = Get-CISExoOutput -Rec $recnum if ($safeAttachmentPolicies -ne 1) { try { # Check if any Safe Attachments policy is enabled (Condition A) diff --git a/source/tests/Test-SafeAttachmentsTeams.ps1 b/source/tests/Test-SafeAttachmentsTeams.ps1 index 123cdbb..5ae5f14 100644 --- a/source/tests/Test-SafeAttachmentsTeams.ps1 +++ b/source/tests/Test-SafeAttachmentsTeams.ps1 @@ -31,7 +31,7 @@ function Test-SafeAttachmentsTeams { } process { - $atpPolicyResult = Get-ExoOutput -Rec $recnum + $atpPolicyResult = Get-CISExoOutput -Rec $recnum if ($atpPolicyResult -ne 1) { try { # Condition A: Check Safe Attachments for SharePoint diff --git a/source/tests/Test-SafeLinksOfficeApps.ps1 b/source/tests/Test-SafeLinksOfficeApps.ps1 index 2388f31..da66d07 100644 --- a/source/tests/Test-SafeLinksOfficeApps.ps1 +++ b/source/tests/Test-SafeLinksOfficeApps.ps1 @@ -42,7 +42,7 @@ function Test-SafeLinksOfficeApps { process { # 2.1.1 (L2) Ensure Safe Links for Office Applications is Enabled # Retrieve all Safe Links policies - $misconfiguredDetails = Get-ExoOutput -Rec $recnum + $misconfiguredDetails = Get-CISExoOutput -Rec $recnum # Misconfigured details returns 1 if EXO Commands needed for the test are not available if ($misconfiguredDetails -ne 1) { try { diff --git a/source/tests/Test-SpamPolicyAdminNotify.ps1 b/source/tests/Test-SpamPolicyAdminNotify.ps1 index 81116fa..9d6779c 100644 --- a/source/tests/Test-SpamPolicyAdminNotify.ps1 +++ b/source/tests/Test-SpamPolicyAdminNotify.ps1 @@ -38,7 +38,7 @@ function Test-SpamPolicyAdminNotify { # 2.1.6 Ensure Exchange Online Spam Policies are set to notify administrators # Retrieve the default hosted outbound spam filter policy - $hostedOutboundSpamFilterPolicy = Get-ExoOutput -Rec $recnum + $hostedOutboundSpamFilterPolicy = Get-CISExoOutput -Rec $recnum # Check if both settings are enabled (Condition A and Condition B for pass) $bccSuspiciousOutboundMailEnabled = $hostedOutboundSpamFilterPolicy.BccSuspiciousOutboundMail diff --git a/tests/Unit/Private/Get-ExoOutput.tests.ps1 b/tests/Unit/Private/Get-CISExoOutput.tests.ps1 similarity index 100% rename from tests/Unit/Private/Get-ExoOutput.tests.ps1 rename to tests/Unit/Private/Get-CISExoOutput.tests.ps1 diff --git a/tests/Unit/Private/Get-MgOutput.tests.ps1 b/tests/Unit/Private/Get-CISMSTeamsOutput.tests.ps1 similarity index 100% rename from tests/Unit/Private/Get-MgOutput.tests.ps1 rename to tests/Unit/Private/Get-CISMSTeamsOutput.tests.ps1 diff --git a/tests/Unit/Private/Get-CISMgOutput.tests.ps1 b/tests/Unit/Private/Get-CISMgOutput.tests.ps1 new file mode 100644 index 0000000..4a2aa69 --- /dev/null +++ b/tests/Unit/Private/Get-CISMgOutput.tests.ps1 @@ -0,0 +1,27 @@ +$ProjectPath = "$PSScriptRoot\..\..\.." | Convert-Path +$ProjectName = ((Get-ChildItem -Path $ProjectPath\*\*.psd1).Where{ + ($_.Directory.Name -match 'source|src' -or $_.Directory.Name -eq $_.BaseName) -and + $(try { Test-ModuleManifest $_.FullName -ErrorAction Stop } catch { $false } ) + }).BaseName + + +Import-Module $ProjectName + +InModuleScope $ProjectName { + Describe Get-PrivateFunction { + Context 'Default' { + BeforeEach { + $return = Get-PrivateFunction -PrivateData 'string' + } + + It 'Returns a single object' { + ($return | Measure-Object).Count | Should -Be 1 + } + + It 'Returns a string based on the parameter PrivateData' { + $return | Should -Be 'string' + } + } + } +} +