DSC Resources version question

This topic contains 2 replies, has 2 voices, and was last updated by  Syl 10 months ago.

  • Author
  • #75004


    When we install a DSCresource (like install-module xSqlServer) it will install it to the folder Powershell\modules\xSqlServer\\

    But then when we call Import-DscResource xSQLServer inside the configuration, it complains the module cannot be found. The only way to make it work is to copy all the files under to the root resource folder Powershell\modules\xSqlServer

    Yet, when we zip that ressource to put it on the pull server, and it is transferred to the target node, it will install itself on the target node under Powershell\modules\xSqlServer\\ and it is working fine

    Is this normal? On the development workstation, should we really put the resources at the root or are we doing something wrong?

    To confuse things further, other resources, like xCertificate, do not create a [version] sub-folder, running install-module xCertificate will install it directly in WindowsPowerShell\Modules\xCertificate

  • #75470

    Don Jones

    Have you tried explicitly stating a version when importing it?

  • #75473


    Indeed I saw that it is the right way to go when importing resources. Especially since resources don't seem to be consistent in the way they install themselves. I have added "always use the resource version when importing" to our internal rule document now 😛


You must be logged in to reply to this topic.