DSC Resources version question

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Sylvain Martel Sylvain Martel 1 week ago.

  • Author
    Posts
  • #75004
    Profile photo of Sylvain Martel
    Sylvain Martel
    Participant

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

    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 7.1.0.0 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\7.1.0.0\ 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
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Have you tried explicitly stating a version when importing it?

  • #75473
    Profile photo of Sylvain Martel
    Sylvain Martel
    Participant

    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 😛

    Thanks!

You must be logged in to reply to this topic.