Created
July 14, 2023 14:57
-
-
Save andikrueger/0336080022bc6d43d4bb3446e8040109 to your computer and use it in GitHub Desktop.
Read function count for Microsoft Graph modules used by Microsoft365DSC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Global:MaximumFunctionCount = 32767 | |
$modules = Get-Module Microsoft.Graph* -ListAvailable | |
foreach ($module in $modules) | |
{ | |
Write-Host "Trying to import $($module.Name)" | |
Write-Host "Module function count $($(Get-Command -Module $module.Name -CommandType Function).Count)" | |
Write-Host "Function Count $($(Get-Command -CommandType Function -ListImported).Count)" | |
try | |
{ | |
Import-Module $module.Name -Force | |
} | |
catch | |
{ | |
Write-Host "Failed to import $($module.Name)" | |
Write-Host $_.Exception.Message | |
} | |
Write-Verbose "Imported $($module.Name)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment