I am working on developing a powershell module that has dependencies on the activedirectory module supplied by Microsoft. I would like to have powershell not load the module if the activedirectory module is not present on the platform. It seems obvious that one would use #Requires -Modules ActiveDirectory for this purpose. This works great in standard powershell scripts (.ps1). It does not, however, seem to be adhered to by the import-module process. Am I missing something, or am I trying to do something that would be bad practice and should be done another way?
Thanks