In powershell 5.1: Connect-MgGraph timeout behavior regression in versions >= 2.35 (does not respect 2-minute timeout)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- powershell
研究方向
首先,在 Windows PowerShell 5.1 下使用模組版本 2.25.0 和 2.37.0 透過 Connect-MgGraph 重現該行為,然後將其與 PowerShell 7 進行比較。當約兩分鐘的逾時受到遵守且 WAM 帳戶選取對話方塊自動關閉時,修正即告完成;該 issue 中未識別來源檔案或測試。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
We've observed a change in timeout behavior for Connect-MgGraph across different versions of the Microsoft.Graph PowerShell module. In our teams this behaviour is
In version 2.25:
- The expected timeout of approximately 2 minutes is respected.
- The account selection window (interactive login) closes correctly when the timeout is reached.
In versions 2.35 and later:
- The operation no longer respects the ~2 minute timeout.
- Instead, it fails after approximately 5 minutes.
- Additionally, the WAM account selection dialog does NOT close automatically when the timeout occurs.
- The dialog remains open indefinitely until manually closed by the user.
Actual behavior:
- Timeout occurs after ~5 minutes.
- WAM dialog remains open and must be closed manually.
This appears to be a regression compared to version 2.25, even though previously it was indicated that timeout behavior had not changed.
The WAM dialog not closing is a known issue?
If needed, we can provide additional environment details.
Additional context:
- This behavior has been reproduced across multiple machines.
- Several team members are experiencing the same issue, so it does not appear to be limited to a single environment or device.
Thanks
Expected behavior
- Timeout occurs after ~2 minutes.
- WAM dialog closes automatically.
How to reproduce
Run with 2.25 first and then with 2.37.0
$ini = Date
Write-Output "${ini}: Inicio"
powershell.exe -command {
$tenantId = "xxxx"
Connect-MgGraph -ErrorAction stop -ContextScope Process -TenantId $tenantId
}
$fin = Date
Write-Warning ("Tardó: {0}" -f ($fin - $ini).totalminutes)
SDK Version
2.37.0
Latest version known to work for scenario above?
2.25.0
Known Workarounds
The workaround I found now is not working, sometimes connect-mggraph hangs
UPDATE: As 2026-07-02 with 110 seconds of timeout the workaround is working
With powershell 7 the behaviour is the correct (change powershell.exe to pwsh.exe)
Debug output
Click to expand log
```</details>
### Configuration
Name Value
---- -----
PSVersion 5.1.22621.6931
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.6931
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
### Other information
_No response_
- 主要語言
- C#
- 星號
- 909
- 分支
- 234
- 平均合併
- 3 天 20 小時
- 30 天內合併 PR
- 19
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoftgraph/msgraph-sdk-powershell 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
microsoftgraph/msgraph-sdk-powershell#3752 ·
維護者通常 1 天內回覆
-
Tracking for V3 Upgrade可能已有人在做 @ramsessanchez 於 8 天前認領。 未關閉type:epic
microsoftgraph/msgraph-sdk-powershell#3874 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
status:waiting-for-triage type:bug
難度 4/5 3-5 天 新手友好度 48/100
microsoftgraph/msgraph-sdk-powershell#3873 ·
維護者通常 1 天內回覆
-
status:waiting-for-triage type:bug
難度 3/5 1-2 天 新手友好度 57/100
microsoftgraph/msgraph-sdk-powershell#3872 ·
維護者通常 1 天內回覆
-
status:waiting-for-triage type:bug
難度 4/5 3-5 天 新手友好度 55/100
microsoftgraph/msgraph-sdk-powershell#3831 ·
維護者通常 1 天內回覆
查看 microsoftgraph/msgraph-sdk-powershell 的全部 Issue
相似的 Issue
-
enhancement ready-for-human
難度 2/5 1-3 小時 新手友好度 62/100
fboucher/2d6-dungeon-app#288 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 80/100
Unity-Technologies/unity-agent-plugin#118 ·
維護者通常 1 天內回覆
-
The Recommended preset turns on Import Uno DSP, which only works with the Material theme可能已有人在做 @agneszitte 今天認領。 未關閉
難度 1/5 1 小時以內 新手友好度 92/100
unoplatform/uno.templates#2388 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 77/100
eyalgolan/statecraft-israel#2732 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
StratumServer/Optimum#198 ·
維護者通常 1 天內回覆