diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e0c390ff9..a4b88a57cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change log for Microsoft365DSC +# 1.21.630.1 + +* O365User + * Fix where export was throwing an error about an empty DSCBlock + ISSUE #1275; +* SPOTenantSettings + * Added support for specifying MarkNewFilesSensitiveByDefault + # 1.21.616.1 * SPOSiteAuditSettings diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADMSGroup/MSFT_AADMSGroup.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADMSGroup/MSFT_AADMSGroup.psm1 index 122796762a..117efed96e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADMSGroup/MSFT_AADMSGroup.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADMSGroup/MSFT_AADMSGroup.psm1 @@ -95,12 +95,12 @@ function Get-TargetResource Write-Verbose -Message "GroupID was specified" try { - $Group = Get-AzureADMSGroup -Id $Id -ErrorAction Stop + $Group = Get-AzureADGroup -ObjectId $Id -ErrorAction Stop } catch { Write-Verbose -Message "Couldn't get group by ID, trying by name" - $Group = Get-AzureADMSGroup -Filter "DisplayName eq '$DisplayName'" -ErrorAction Stop + $Group = Get-AzureADGroup -Filter "DisplayName eq '$DisplayName'" -ErrorAction Stop if ($Group.Length -gt 1) { throw "Duplicate AzureAD Groups named $DisplayName exist in tenant" @@ -111,7 +111,7 @@ function Get-TargetResource { Write-Verbose -Message "Id was NOT specified" ## Can retreive multiple AAD Groups since displayname is not unique - $Group = Get-AzureADMSGroup -Filter "DisplayName eq '$DisplayName'" -ErrorAction Stop + $Group = Get-AzureADGroup -Filter "DisplayName eq '$DisplayName'" -ErrorAction Stop if ($Group.Length -gt 1) { throw "Duplicate AzureAD Groups named $DisplayName exist in tenant" @@ -468,7 +468,7 @@ function Export-TargetResource try { - [array] $groups = Get-AzureADMSGroup -All:$true -ErrorAction Stop + [array] $groups = Get-AzureADGroup -All:$true -ErrorAction Stop $i = 1 $dscContent = '' Write-Host "`r`n" -NoNewline diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/MSFT_O365User.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/MSFT_O365User.psm1 index ef15d3f91f..db2b7ccd27 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/MSFT_O365User.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/MSFT_O365User.psm1 @@ -751,7 +751,7 @@ function Export-TargetResource -ModulePath $PSScriptRoot ` -Results $Results ` -GlobalAdminAccount $GlobalAdminAccount - $currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentContent -ParameterName "Password" + $currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName "Password" $dscContent += $currentDSCBlock Save-M365DSCPartialExport -Content $currentDSCBlock ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.psm1 index 69a86e999f..643ab24053 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.psm1 @@ -78,6 +78,11 @@ function Get-TargetResource [System.Boolean] $HideDefaultThemes, + [Parameter()] + [ValidateSet("AllowExternalSharing", "BlockExternalSharing")] + [System.String] + $MarkNewFilesSensitiveByDefault, + [Parameter()] [ValidateSet("Present", "Absent")] [System.String] @@ -160,6 +165,7 @@ function Get-TargetResource ApplyAppEnforcedRestrictionsToAdHocRecipients = $SPOTenantSettings.ApplyAppEnforcedRestrictionsToAdHocRecipients FilePickerExternalImageSearchEnabled = $SPOTenantSettings.FilePickerExternalImageSearchEnabled HideDefaultThemes = $SPOTenantSettings.HideDefaultThemes + MarkNewFilesSensitiveByDefault = $SPOTenantSettings.MarkNewFilesSensitiveByDefault GlobalAdminAccount = $GlobalAdminAccount ApplicationId = $ApplicationId TenantId = $TenantId @@ -277,6 +283,11 @@ function Set-TargetResource [System.Boolean] $HideDefaultThemes, + [Parameter()] + [ValidateSet("AllowExternalSharing", "BlockExternalSharing")] + [System.String] + $MarkNewFilesSensitiveByDefault, + [Parameter()] [ValidateSet("Present", "Absent")] [System.String] @@ -422,6 +433,11 @@ function Test-TargetResource [System.Boolean] $HideDefaultThemes, + [Parameter()] + [ValidateSet("AllowExternalSharing", "BlockExternalSharing")] + [System.String] + $MarkNewFilesSensitiveByDefault, + [Parameter()] [ValidateSet("Present", "Absent")] [System.String] @@ -492,7 +508,9 @@ function Test-TargetResource "OwnerAnonymousNotification", ` "ApplyAppEnforcedRestrictionsToAdHocRecipients", ` "FilePickerExternalImageSearchEnabled", ` - "HideDefaultThemes") + "HideDefaultThemes", ` + "MarkNewFilesSensitiveByDefault" + ) Write-Verbose -Message "Test-TargetResource returned $TestResult" return $TestResult diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.schema.mof index b69040de5f..30ec1cae29 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.schema.mof @@ -19,6 +19,7 @@ class MSFT_SPOTenantSettings : OMI_BaseResource [Write, Description("")] boolean ApplyAppEnforcedRestrictionsToAdHocRecipients; [Write, Description("")] boolean FilePickerExternalImageSearchEnabled; [Write, Description("Defines if the default themes are visible or hidden")] boolean HideDefaultThemes; + [Write, Description("Allow or block external sharing until at least one Office DLP policy scans the content of the file."), ValueMap{"AllowExternalSharing","BlockExternalSharing"}, Values{"AllowExternalSharing","BlockExternalSharing"}] string MarkNewFilesSensitiveByDefault; [Write, Description("Only accepted value is 'Present'."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; [Write, Description("Credentials of the SharePoint Global Admin"), EmbeddedInstance("MSFT_Credential")] string GlobalAdminAccount; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; diff --git a/Modules/Microsoft365DSC/Examples/Resources/SPOTenantSettings/1-ConfigureSPOTenantSettings.ps1 b/Modules/Microsoft365DSC/Examples/Resources/SPOTenantSettings/1-ConfigureSPOTenantSettings.ps1 index ed3f5df14d..3b8a55b594 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/SPOTenantSettings/1-ConfigureSPOTenantSettings.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/SPOTenantSettings/1-ConfigureSPOTenantSettings.ps1 @@ -34,6 +34,7 @@ Configuration Example ApplyAppEnforcedRestrictionsToAdHocRecipients = $true FilePickerExternalImageSearchEnabled = $true HideDefaultThemes = $false + MarkNewFilesSensitiveByDefault = "AllowExternalSharing" Ensure = "Present" } } diff --git a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 index 0626043828..95484449ec 100644 --- a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 +++ b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 2021-06-16 +# Generated on: 2021-06-30 @{ @@ -11,7 +11,7 @@ # RootModule = '' # Version number of this module. - ModuleVersion = '1.21.616.1' + ModuleVersion = '1.21.630.1' # Supported PSEditions # CompatiblePSEditions = @() @@ -177,13 +177,11 @@ IconUri = 'https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Dependencies/Images/Logo.png?raw=true' # ReleaseNotes of this module - ReleaseNotes = "* SPOSiteAuditSettings - * Fixed issue with Export where property Ensure was added - when an access forbidden error was encountered; - * DEPENDENCIES - * Updated Microsoft.Graph.Authentication to version 1.6.0; - * Updated Microsoft.Graph.Planner to version 1.6.0; - * Updated Microsoft.Graph.Teams to version 1.6.0;" + ReleaseNotes = "* O365User + * Fix where export was throwing an error about an empty DSCBlock + ISSUE #1275; + * SPOTenantSettings + * Added support for specifying MarkNewFilesSensitiveByDefault" # Flag to indicate whether the module requires explicit user acceptance for install/update # RequireLicenseAcceptance = $false diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADMSGroup.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADMSGroup.Tests.ps1 index 5a8392d8b0..5f267728d5 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADMSGroup.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADMSGroup.Tests.ps1 @@ -71,13 +71,13 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { return "Credential" } - Mock -CommandName Get-AzureADMSGroup -MockWith { + Mock -CommandName Get-AzureADGroup -MockWith { return $null } } It "Should return Values from the Get method" { (Get-TargetResource @testParams).Ensure | Should -Be 'Absent' - Should -Invoke -CommandName "Get-AzureADMSGroup" -Exactly 1 + Should -Invoke -CommandName "Get-AzureADGroup" -Exactly 1 } It 'Should return false from the Test method' { Test-TargetResource @testParams | Should -Be $false @@ -106,7 +106,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { return "Credential" } - Mock -CommandName Get-AzureADMSGroup -MockWith { + Mock -CommandName Get-AzureADGroup -MockWith { return @{DisplayName = "DSCGroup" ID = "12345-12345-12345-12345" } } @@ -114,7 +114,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It "Should return Values from the Get method" { (Get-TargetResource @testParams).Ensure | Should -Be 'Present' - Should -Invoke -CommandName "Get-AzureADMSGroup" -Exactly 1 + Should -Invoke -CommandName "Get-AzureADGroup" -Exactly 1 } It 'Should return true from the Test method' { @@ -145,7 +145,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { return "Credential" } - Mock -CommandName Get-AzureADMSGroup -MockWith { + Mock -CommandName Get-AzureADGroup -MockWith { return @{ DisplayName = "DSCGroup" ID = "12345-12345-12345-12345" @@ -162,7 +162,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It "Should return Values from the Get method" { Get-TargetResource @testParams - Should -Invoke -CommandName "Get-AzureADMSGroup" -Exactly 1 + Should -Invoke -CommandName "Get-AzureADGroup" -Exactly 1 } It 'Should return true from the Test method' { @@ -188,7 +188,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { return "Credential" } - Mock -CommandName Get-AzureADMSGroup -MockWith { + Mock -CommandName Get-AzureADGroup -MockWith { return @{ DisplayName = "DSCGroup" Description = "Microsoft DSC" #Drift @@ -200,7 +200,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } } - Mock -CommandName Get-AzureADMSGroup -MockWith { + Mock -CommandName Get-AzureADGroup -MockWith { return @{DisplayName = "DSCGroup" ID = "12345-12345-12345-12345" } } @@ -208,7 +208,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It "Should return Values from the Get method" { Get-TargetResource @testParams - Should -Invoke -CommandName "Get-AzureADMSGroup" -Exactly 1 + Should -Invoke -CommandName "Get-AzureADGroup" -Exactly 1 } It 'Should return false from the Test method' { @@ -231,7 +231,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { return "Credential" } - Mock -CommandName Get-AzureADMSGroup -MockWith { + Mock -CommandName Get-AzureADGroup -MockWith { return @{ DisplayName = "Test Team" ID = "12345-12345-12345-12345" diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADRoleDefinition.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADRoleDefinition.Tests.ps1 index c3540dea2e..7c0f39cfb1 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADRoleDefinition.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADRoleDefinition.Tests.ps1 @@ -23,12 +23,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "test@password1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName Get-PSSession -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOManagementRole.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOManagementRole.Tests.ps1 index cff570d194..f463d8c944 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOManagementRole.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOManagementRole.Tests.ps1 @@ -24,12 +24,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "test@password1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOTransportRule.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOTransportRule.Tests.ps1 index 73963d04a7..3c63d1eed8 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOTransportRule.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOTransportRule.Tests.ps1 @@ -23,12 +23,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "test@password1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSite.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSite.Tests.ps1 index d719665dc3..dbf3b798a2 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSite.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSite.Tests.ps1 @@ -24,17 +24,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "test@password1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin@contoso.onmicrosoft.com", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { - return $Results + return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - return @" - SPOSite Test - { - Url = https://contoso.sharepoint.com - } -"@ + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName Set-PnPTenantSite -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSiteAuditSettings.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSiteAuditSettings.Tests.ps1 index e87c0127d0..557b286225 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSiteAuditSettings.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSiteAuditSettings.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSiteDesign.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSiteDesign.Tests.ps1 index 5a2b597896..14cd325704 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSiteDesign.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSiteDesign.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSiteDesignRights.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSiteDesignRights.Tests.ps1 index 422197d36d..4d6806a45e 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSiteDesignRights.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.SPOSiteDesignRights.Tests.ps1 @@ -25,12 +25,16 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { + } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsCallingPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsCallingPolicy.Tests.ps1 index 3f4a83e928..2e3eaa0e93 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsCallingPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsCallingPolicy.Tests.ps1 @@ -25,14 +25,19 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } - + Mock -CommandName New-M365DSCConnection -MockWith { return "Credential" } @@ -218,7 +223,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $testParams = @{ GlobalAdminAccount = $GlobalAdminAccount } - Mock -CommandName Get-CsTeamsCallingPolicy -MockWith { return @{ Identity = 'Test Calling Policy' diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsChannel.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsChannel.Tests.ps1 index 9e26a780f5..8a1d931672 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsChannel.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsChannel.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsChannelTab.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsChannelTab.Tests.ps1 index 600b991e76..f903b0b7fa 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsChannelTab.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsChannelTab.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { @@ -290,7 +293,9 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name "ReverseDSC Tests" -Fixture { BeforeAll { $testParams = @{ - GlobalAdminAccount = $GlobalAdminAccount + ApplicationId = "12345-12345-12345-12345-12345" + TenantID = "11111-11111-22222-22222-22222" + CertificateThumbprint = "111111111111" } Mock -CommandName Get-Team -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsChannelsPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsChannelsPolicy.Tests.ps1 index 055b369497..993bdf4ff2 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsChannelsPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsChannelsPolicy.Tests.ps1 @@ -25,14 +25,16 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } - Mock -CommandName New-M365DSCConnection -MockWith { return "Credential" } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsClientConfiguration.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsClientConfiguration.Tests.ps1 index ac285ccb9f..fbd310cc74 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsClientConfiguration.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsClientConfiguration.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEmergencyCallRoutingPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEmergencyCallRoutingPolicy.Tests.ps1 index 164c4b20f0..dd113097b3 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEmergencyCallRoutingPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEmergencyCallRoutingPolicy.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEmergencyCallingPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEmergencyCallingPolicy.Tests.ps1 index 7c21a3ffc0..e98ea6cb34 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEmergencyCallingPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEmergencyCallingPolicy.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsGuestCallingConfiguration.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsGuestCallingConfiguration.Tests.ps1 index 792f9fcb07..3904e1c8c0 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsGuestCallingConfiguration.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsGuestCallingConfiguration.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsGuestMeetingConfiguration.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsGuestMeetingConfiguration.Tests.ps1 index 1096e8418a..b607673775 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsGuestMeetingConfiguration.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsGuestMeetingConfiguration.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsGuestMessagingConfiguration.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsGuestMessagingConfiguration.Tests.ps1 index 95731a56e8..28eb4544d9 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsGuestMessagingConfiguration.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsGuestMessagingConfiguration.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingBroadcastConfiguration.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingBroadcastConfiguration.Tests.ps1 index bd0c9b64fd..96915e71b6 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingBroadcastConfiguration.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingBroadcastConfiguration.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingBroadcastPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingBroadcastPolicy.Tests.ps1 index 941db96b07..955518d067 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingBroadcastPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingBroadcastPolicy.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingConfiguration.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingConfiguration.Tests.ps1 index 48df2ea5bc..5426e0297e 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingConfiguration.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingConfiguration.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingPolicy.Tests.ps1 index 24335110ac..c020ca3426 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMeetingPolicy.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMessagingPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMessagingPolicy.Tests.ps1 index 80f66068ec..73b5785a36 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMessagingPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMessagingPolicy.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsPstnUsage.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsPstnUsage.Tests.ps1 index 013843d2a3..9c426e677b 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsPstnUsage.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsPstnUsage.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString 'Pass@word1' -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ('tenantadmin', $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsTeam.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsTeam.Tests.ps1 index efb21958d9..0735b1d530 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsTeam.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsTeam.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin@contoso.com", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsTenantDialPlan.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsTenantDialPlan.Tests.ps1 index e643ef1b9d..5648321a85 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsTenantDialPlan.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsTenantDialPlan.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUpgradeConfiguration.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUpgradeConfiguration.Tests.ps1 index 0e5d8547b8..33548ed6af 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUpgradeConfiguration.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUpgradeConfiguration.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUpgradePolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUpgradePolicy.Tests.ps1 index 6149dfb01c..bf073d0f84 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUpgradePolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUpgradePolicy.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUser.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUser.Tests.ps1 index 864ddbf5af..a6798b64de 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUser.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUser.Tests.ps1 @@ -24,12 +24,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1)" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsVoiceRoute.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsVoiceRoute.Tests.ps1 index 273d91b460..a04628084a 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsVoiceRoute.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsVoiceRoute.Tests.ps1 @@ -24,7 +24,16 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { BeforeAll { $secpasswd = ConvertTo-SecureString "Pass@word1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" + Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { + return @{} + } + Mock -CommandName Get-M365DSCExportContentForResource -MockWith { + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { + } Mock -CommandName Test-MSCloudLogin -MockWith { } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsVoiceRoutingPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsVoiceRoutingPolicy.Tests.ps1 index 4df8dc63cd..34f0a885df 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsVoiceRoutingPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsVoiceRoutingPolicy.Tests.ps1 @@ -25,12 +25,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $secpasswd = ConvertTo-SecureString "Pass@word1" -AsPlainText -Force $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + $Global:PartialExportFileName = "c:\TestPath" Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { return @{} } Mock -CommandName Get-M365DSCExportContentForResource -MockWith { - + return "FakeDSCContent" + } + Mock -CommandName Save-M365DSCPartialExport -MockWith { } Mock -CommandName New-M365DSCConnection -MockWith {