diff --git a/.github/workflows/CodeCoverage.yml b/.github/workflows/CodeCoverage.yml index 656062ed9f..12de9e7d3b 100644 --- a/.github/workflows/CodeCoverage.yml +++ b/.github/workflows/CodeCoverage.yml @@ -25,7 +25,7 @@ jobs: shell: pwsh run: | Import-Module './Tests/TestHarness.psm1' -Force; - $MaximumFunctionCount = 9999 + $MaximumFunctionCount = 32767 try { @@ -33,7 +33,7 @@ jobs: } catch { - $MaximumFunctionCount = 9999 + $MaximumFunctionCount = 32767 Import-Module './Tests/TestHarness.psm1' -Force; $results = Invoke-QualityChecksHarness } @@ -45,7 +45,7 @@ jobs: shell: pwsh run: | Import-Module './Tests/TestHarness.psm1' -Force; - $MaximumFunctionCount = 9999 + $MaximumFunctionCount = 32767 try { @@ -53,7 +53,7 @@ jobs: } catch { - $MaximumFunctionCount = 9999 + $MaximumFunctionCount = 32767 Import-Module './Tests/TestHarness.psm1' -Force; $results = Invoke-TestHarness } diff --git a/.github/workflows/Unit Tests.yml b/.github/workflows/Unit Tests.yml index 21ba42fd4b..5276499448 100644 --- a/.github/workflows/Unit Tests.yml +++ b/.github/workflows/Unit Tests.yml @@ -27,7 +27,7 @@ jobs: shell: pwsh run: | Import-Module './Tests/TestHarness.psm1' -Force; - $MaximumFunctionCount = 9999 + $MaximumFunctionCount = 32767 try { @@ -35,7 +35,7 @@ jobs: } catch { - $MaximumFunctionCount = 9999 + $MaximumFunctionCount = 32767 Import-Module './Tests/TestHarness.psm1' -Force; $results = Invoke-QualityChecksHarness } @@ -47,7 +47,7 @@ jobs: shell: pwsh run: | Import-Module './Tests/TestHarness.psm1' -Force; - $MaximumFunctionCount = 9999 + $MaximumFunctionCount = 32767 try { @@ -55,7 +55,7 @@ jobs: } catch { - $MaximumFunctionCount = 9999 + $MaximumFunctionCount = 32767 Import-Module './Tests/TestHarness.psm1' -Force; $results = Invoke-TestHarness -IgnoreCodeCoverage } diff --git a/CHANGELOG.md b/CHANGELOG.md index cd75269b82..70ecd86a45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,13 @@ # Change log for Microsoft365DSC # UNRELEASED + * AADGroup * Fix issue setting MemberOf property. FIXES [#3496](https://github.com/microsoft/Microsoft365DSC/issues/3496) +* MISC + * Improved Update-M365DSCDependencies function to properly install all Microsoft.Graph.* modules. + FIXES [#3454](https://github.com/microsoft/Microsoft365DSC/issues/3454) # 1.23.719.1 * AADCrossTenant diff --git a/Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1 index 9c98de1707..d28556058d 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1 @@ -1155,7 +1155,7 @@ function Export-M365DSCConfiguration $Validate ) - $Global:MaximumFunctionCount = 16000 + $Global:MaximumFunctionCount = 32767 # Define the exported resource instances' names Global variable $Global:M365DSCExportedResourceInstancesNames = @() @@ -1661,7 +1661,7 @@ function New-M365DSCConnection $SkipModuleReload = $false ) - $Global:MaximumFunctionCount = 16000 + $Global:MaximumFunctionCount = 32767 if ($Workload -eq 'MicrosoftTeams') { @@ -2757,6 +2757,7 @@ function Update-M365DSCDependencies $ValidateOnly ) + $Global:MaximumFunctionCount = 32767 $InformationPreference = 'Continue' $currentPath = Join-Path -Path $PSScriptRoot -ChildPath '..\' -Resolve @@ -2782,8 +2783,12 @@ function Update-M365DSCDependencies { Write-Information -MessageData "Installing $($dependency.ModuleName) version {$($dependency.RequiredVersion)}" Remove-Module $dependency.ModuleName -Force -ErrorAction SilentlyContinue + if ($dependency.ModuleName -like 'Microsoft.Graph*') + { + Remove-Module 'Microsoft.Graph.Authentication' -Force -ErrorAction SilentlyContinue + } + Remove-Module $dependency.ModuleName -Force -ErrorAction SilentlyContinue Install-Module $dependency.ModuleName -RequiredVersion $dependency.RequiredVersion -AllowClobber -Force -Scope 'AllUsers' - Import-Module $dependency.ModuleName -Force } else { @@ -2801,6 +2806,7 @@ function Update-M365DSCDependencies Write-Host "Could not update or import {$($dependency.ModuleName)}" Write-Host "Error-Mesage: $($_.Exception.Message)" } + $i++ } diff --git a/Tests/TestHarness.psm1 b/Tests/TestHarness.psm1 index 36222dc7f9..0d93e4c7f9 100644 --- a/Tests/TestHarness.psm1 +++ b/Tests/TestHarness.psm1 @@ -18,7 +18,7 @@ function Invoke-TestHarness $sw = [System.Diagnostics.StopWatch]::startnew() - $MaximumFunctionCount = 9999 + $MaximumFunctionCount = 32767 Write-Host -Object 'Running all Microsoft365DSC Unit Tests' $repoDir = Join-Path -Path $PSScriptRoot -ChildPath '..\' -Resolve