PowerShell: AzureAD vs. AzureADPreview Modules

Windows PowerShellAs of today, the current versions of the AzureAD and AzureADPreview PowerShell modules stand at 2.0.2.140 (2021-08-19) and 2.0.2.149 (2022-02-01) respectively.

This means that a number of useful cmdlets such as Get-AzureADPolicy and Get-AzureADDirectorySetting  will trigger similar errors as follows if the preview module is not installed and/or loaded via Import-Module in your (production) environment:

Get-AzureADDirectorySetting : The term ‘Get-AzureADDirectorySetting’ is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ Get-AzureADDirectorySetting
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-AzureADDirectorySetting:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException