Skip to content

Instantly share code, notes, and snippets.

@andikrueger
Created July 14, 2023 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andikrueger/0336080022bc6d43d4bb3446e8040109 to your computer and use it in GitHub Desktop.
Save andikrueger/0336080022bc6d43d4bb3446e8040109 to your computer and use it in GitHub Desktop.
Read function count for Microsoft Graph modules used by Microsoft365DSC
$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