I have a machine with the modules AzureAD and Az installed.
Executing Import-Module AzureAD or Import-Module Az both work OK from within Powershell ISE.
When putting Import-Module AzureAD inside a Try Catch it still works, however putting Import-Module Az inside a Try Catch blocks the ISE (I have to close it or end the statement with Ctrl-C).
My question is: what can cause the import to fail in this way? Why only with the Az module and why only inside a Try Catch?