Azure / Azure/azure-powershell
[Az.Tools.Predictor] network requests block initialization loading
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description
`Import-Module Az.Tools.Predictor`
This command will request network data when loading, which is slow and will block for a while.
If the network is bad or disconnected, it will be stuck for a long time (10~20s).
in my profile:
```
echo "Loading Predictor..."
date "+%Y-%m-%d %H:%M:%S.%3N %Z"
Import-Module Az.Tools.Predictor
echo "Loading Predictor...Done"
date "+%Y-%m-%d %H:%M:%S.%3N %Z"
```
Time consuming below:
### Issue script & Debug output
```PowerShell
enable & online
PowerShell 7.5.2
Loading Predictor...
2025-08-14 14:37:03.838
Loading Predictor...Done
2025-08-14 14:37:05.121
Loading personal and system profiles took 2172ms.
enable & offline
PowerShell 7.5.2
Loading Predictor...
2025-08-14 14:38:53.362
Loading Predictor...Done
2025-08-14 14:39:11.160
Loading personal and system profiles took 18677ms.
disable & online
PowerShell 7.5.2
Loading Predictor...
2025-08-14 14:37:41.424
Loading Predictor...Done
2025-08-14 14:37:41.487
Loading personal and system profiles took 855ms.
disable & offline
PowerShell 7.5.2
Loading Predictor...
2025-08-14 14:40:02.901
Loading Predictor...Done
2025-08-14 14:40:02.965
Loading personal and system profiles took 882ms.
```
### Environment data
```PowerShell
Name Value
---- -----
PSVersion 7.5.2
PSEdition Core
GitCommitId 7.5.2
OS Microsoft Windows 10.0.26100
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```
### Module versions
```PowerShell
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 1.1.3 Az.Tools.Predictor {Disable-AzPredictor, Enable-AzPredictor, Open-AzPredictorSurvey, Send-AzPredictorRating}
```
### Error output
```PowerShell
```
Contributor guide
Research direction
Start by reproducing the reported timings around the `Import-Module Az.Tools.Predictor` entry point in PowerShell, both online and offline, then trace the module initialization that performs network requests. Done means importing the module no longer blocks for 10–20 seconds when the network is unavailable, with coverage for the affected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- cli, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100