Import-DscResource dependent on external assembly

I’m creating a dsc configuration to install and configure a SQL box. I have created some custom resources using SQL management objects Microsoft.SqlServer.Smo.dll.

The problem I get is that when the import-dscresource runs on the server it tries to load all the resource modules which in turn tries to load the Microsoft.SqlServer.Smo.dll. This DLL won’t be available on the server until the SQL install has run and complete.

Is there anyway to prevent the DSC resource trying to load the external assembly until it runs the DSCResource ? I have made the DSCResource dependent on the SQL Server install completing successfully, but the import-module runs at the start of the script regardless.

Please ignore - User Error :-s