Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Update-M365DSCDependency function to fix issues with MaxFunctionCount #3504

Merged
merged 3 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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