ExternalModuleDependencies / RequiredModules??

I’m trying to set up a module that’s used as a toolbox for our Office365 deployment. I’ve managed to setup a Nexus (nuget) repository locally to store the module, but I’m a bit stuck on configuring the ExternalModuleDependencies ore is it RequiredModules in the Manifest for the module. As I understood it the dependant modules should be checked when the module is install or imported, or even run! However the custom cmdlets just error, after I import the required modules, everything works okay.
I’ve added this to the PSData hashtable.

ExternalModuleDependencies = @('ActiveDirectory','AzureAD','SkypeOnlineConnector','SkypeForBusiness')

Is this correct, I’m guessing I’m missing something here. Do I have to add the import-module commands to the psm1? I thought this was automatic on PS 5.


ExternalModuleDependencies doesn’t auto-import, no. See New-ModuleManifest (Microsoft.PowerShell.Core) - PowerShell | Microsoft Docs; use RequiredModules to auto-import.

Thanks for the reply.
I ended up using the RequiredModules and ExternalModuleDependencies. It’s now doing what I want it to.

RequiredModules = @(
    @{ModuleName="AzureADpreview"; ModuleVersion="";Guid="b433e830-b479-4f7f-9c80-9cc6c28e1b51"}


ExternalModuleDependencies = @('ActiveDirectory','AzureADpreview','SkypeOnlineConnector','SkypeForBusiness')