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
Importing of Microsoft.Graph Hangs on checking .net4.7.2 requirements steps for 10+min #2479
Comments
Hi @dujuantaylor502 the errors you are getting is unfortunately a PowerShell 5.1 limitation.
|
Thanks for this information. I have tried the steps mentioned below and got the same result. I will test with PS 7 today to see if anything is different and let you know.
For the second item we were testing the following code to import and noticed the .net check hang from verbose logging at the groups and user modules
Import-Module Microsoft.Graph.Authentication
Import-Module Microsoft.Graph.Groups
Import-Module Microsoft.Graph.Users
We have the following in our code today as well:
$maximumfunctioncount = 32768
From: Tim ***@***.***>
Sent: Tuesday, December 19, 2023 12:27 AM
To: microsoftgraph/msgraph-sdk-powershell ***@***.***>
Cc: Taylor, Dujuan X ***@***.***>; Mention ***@***.***>
Subject: Re: [microsoftgraph/msgraph-sdk-powershell] Importing of Microsoft.Graph Hangs on checking .net4.7.2 requirements steps for 10+min (Issue #2479)
You don't often get email from ***@***.******@***.***>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
CAUTION:This email originated from a sender external to Express. Do not click links or open attachments unless you recognize the sender and know the content is safe. If you suspect this email could be phishing, please report it by using the "Report Message" button at the top of your screen.
Hi @dujuantaylor502<https://github.com/dujuantaylor502> the errors you are getting is unfortunately a PowerShell 5.1 limitation<PowerShell/PowerShell#2221>.
You need to explore the following options as an alternative.
* Use the latest version of PowerShell 7+ as the runtime version.
* Only load the modules that you require. See list of modules here<https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.applications/?view=graph-powershell-1.0>
* Set $maximumfunctioncount<https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md#maximumfunctioncount> variable to its max value, 32768.
-
Reply to this email directly, view it on GitHub<#2479 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BEPPPRHCKNTMMO3Y3RRXLYDYKEXSPAVCNFSM6AAAAABAIJ6M32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRSGE4TKMBXGU>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
With PowerShell 7 we are still seeing a delay for importing the modules. It has been a little faster in some instances but we are still seeing about 5min now.
From: Taylor, Dujuan X
Sent: Tuesday, December 19, 2023 2:05 PM
To: microsoftgraph/msgraph-sdk-powershell ***@***.***>; microsoftgraph/msgraph-sdk-powershell ***@***.***>
Cc: Mention ***@***.***>
Subject: RE: [microsoftgraph/msgraph-sdk-powershell] Importing of Microsoft.Graph Hangs on checking .net4.7.2 requirements steps for 10+min (Issue #2479)
Thanks for this information. I have tried the steps mentioned below and got the same result. I will test with PS 7 today to see if anything is different and let you know.
For the second item we were testing the following code to import and noticed the .net check hang from verbose logging at the groups and user modules
Import-Module Microsoft.Graph.Authentication
Import-Module Microsoft.Graph.Groups
Import-Module Microsoft.Graph.Users
We have the following in our code today as well:
$maximumfunctioncount = 32768
From: Tim ***@***.******@***.***>>
Sent: Tuesday, December 19, 2023 12:27 AM
To: microsoftgraph/msgraph-sdk-powershell ***@***.******@***.***>>
Cc: Taylor, Dujuan X ***@***.******@***.***>>; Mention ***@***.******@***.***>>
Subject: Re: [microsoftgraph/msgraph-sdk-powershell] Importing of Microsoft.Graph Hangs on checking .net4.7.2 requirements steps for 10+min (Issue #2479)
You don't often get email from ***@***.******@***.***>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
CAUTION:This email originated from a sender external to Express. Do not click links or open attachments unless you recognize the sender and know the content is safe. If you suspect this email could be phishing, please report it by using the "Report Message" button at the top of your screen.
Hi @dujuantaylor502<https://github.com/dujuantaylor502> the errors you are getting is unfortunately a PowerShell 5.1 limitation<PowerShell/PowerShell#2221>.
You need to explore the following options as an alternative.
* Use the latest version of PowerShell 7+ as the runtime version.
* Only load the modules that you require. See list of modules here<https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.applications/?view=graph-powershell-1.0>
* Set $maximumfunctioncount<https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md#maximumfunctioncount> variable to its max value, 32768.
-
Reply to this email directly, view it on GitHub<#2479 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BEPPPRHCKNTMMO3Y3RRXLYDYKEXSPAVCNFSM6AAAAABAIJ6M32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRSGE4TKMBXGU>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
@dujuantaylor502 I'm still not able to reproduce your issue because when I try it on both PowerShell 5 and 7, it takes less than 20s. However, in PowerShell 7 installed modules are automatically imported to the session when you use any commands or providers in the module. If you are running a script, you should consider removing those import declarations. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
Thanks for reporting the bug. Please ensure you've gone through the following checklist before opening an issue:
Describe the bug
When running command "import-module microsoft.graph -verbose" it takes about 10min on the checking .net 4.7.2 requirements step.
To Reproduce
Steps to reproduce the behavior:
run command "import-module microsoft.graph -verbose" after installing the module
on the verbose step of checking .net 4.7.2 requirements it hangs for about 10min before proceeding
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.7.2 because it is not included in the list of permitted versions.
Expected behavior
Debug Output
VERBOSE: Loading module from path 'C:\Program
Files\WindowsPowerShell\Modules\microsoft.graph\1.27.0\microsoft.gra
ph.psd1'.
VERBOSE: Cannot verify the Microsoft .NET Framework version 4.7.2
because it is not included in the list of permitted versions.
WARNING: Selected Microsoft Graph profile 'v1.0' does not exist for module 'Microsoft.Graph.Financials'. No cmdlets were loaded.
WARNING: Selected Microsoft Graph profile 'v1.0' does not exist for module 'Microsoft.Graph.WindowsUpdates'. No cmdlets were loaded.
Import-Module : Function Disable-MgDeviceManagementManagedDeviceLostMode cannot be created because function capacity 4096 has been exceeded for this scope.
At line:1 char:1
Module Version
Environment Data
PSVersion 5.1.19041.3693
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.3693
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Screenshots
Additional context
N/A
The text was updated successfully, but these errors were encountered: