I know already this is a case of “works on my machine”, or in this case…doesn’t.
But in Cloud Shell or a different machine if i use
#requires az
or import module
In a script then all 64 az modules get loaded in 10 seconds.
On a corporate laptop it takes 15+ minutes! I’ve tried to dig in to why this is without much luck
I’ve tried putting an exclusion in windows defender but still the same.
Any tips on getting more details on what’s slowing things down would be most appreciated, it’s making using #Requires -Module
Untenable.
What is the PowerShell version you use in local machine ?
Just a guess, In cloudshell, az modules might have already loaded, so reimporting wont make time, check if Import-Module with -Force is also quick in couldshell.