Skip to content

Commit

Permalink
Merge pull request #3504 from andikrueger/andikrueger/issue3454_1
Browse files Browse the repository at this point in the history
Updated Update-M365DSCDependency function to fix issues with MaxFunctionCount
  • Loading branch information
NikCharlebois authored Jul 26, 2023
2 parents 278eee3 + f4c37c1 commit 8a59d1a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CodeCoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ jobs:
shell: pwsh
run: |
Import-Module './Tests/TestHarness.psm1' -Force;
$MaximumFunctionCount = 9999
$MaximumFunctionCount = 32767
try
{
$results = Invoke-QualityChecksHarness
}
catch
{
$MaximumFunctionCount = 9999
$MaximumFunctionCount = 32767
Import-Module './Tests/TestHarness.psm1' -Force;
$results = Invoke-QualityChecksHarness
}
Expand All @@ -45,15 +45,15 @@ jobs:
shell: pwsh
run: |
Import-Module './Tests/TestHarness.psm1' -Force;
$MaximumFunctionCount = 9999
$MaximumFunctionCount = 32767
try
{
$results = Invoke-TestHarness
}
catch
{
$MaximumFunctionCount = 9999
$MaximumFunctionCount = 32767
Import-Module './Tests/TestHarness.psm1' -Force;
$results = Invoke-TestHarness
}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/Unit Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ jobs:
shell: pwsh
run: |
Import-Module './Tests/TestHarness.psm1' -Force;
$MaximumFunctionCount = 9999
$MaximumFunctionCount = 32767
try
{
$results = Invoke-QualityChecksHarness
}
catch
{
$MaximumFunctionCount = 9999
$MaximumFunctionCount = 32767
Import-Module './Tests/TestHarness.psm1' -Force;
$results = Invoke-QualityChecksHarness
}
Expand All @@ -47,15 +47,15 @@ jobs:
shell: pwsh
run: |
Import-Module './Tests/TestHarness.psm1' -Force;
$MaximumFunctionCount = 9999
$MaximumFunctionCount = 32767
try
{
$results = Invoke-TestHarness -IgnoreCodeCoverage
}
catch
{
$MaximumFunctionCount = 9999
$MaximumFunctionCount = 32767
Import-Module './Tests/TestHarness.psm1' -Force;
$results = Invoke-TestHarness -IgnoreCodeCoverage
}
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 9 additions & 3 deletions Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ function Export-M365DSCConfiguration
$Validate
)

$Global:MaximumFunctionCount = 16000
$Global:MaximumFunctionCount = 32767

# Define the exported resource instances' names Global variable
$Global:M365DSCExportedResourceInstancesNames = @()
Expand Down Expand Up @@ -1661,7 +1661,7 @@ function New-M365DSCConnection
$SkipModuleReload = $false
)

$Global:MaximumFunctionCount = 16000
$Global:MaximumFunctionCount = 32767

if ($Workload -eq 'MicrosoftTeams')
{
Expand Down Expand Up @@ -2757,6 +2757,7 @@ function Update-M365DSCDependencies
$ValidateOnly
)

$Global:MaximumFunctionCount = 32767

$InformationPreference = 'Continue'
$currentPath = Join-Path -Path $PSScriptRoot -ChildPath '..\' -Resolve
Expand All @@ -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
{
Expand All @@ -2801,6 +2806,7 @@ function Update-M365DSCDependencies
Write-Host "Could not update or import {$($dependency.ModuleName)}"
Write-Host "Error-Mesage: $($_.Exception.Message)"
}

$i++
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/TestHarness.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8a59d1a

Please sign in to comment.