DSC Resources version question

Welcome Forums DSC (Desired State Configuration) DSC Resources version question

This topic contains 2 replies, has 2 voices, and was last updated by

Syl
 
Participant
1 year, 3 months ago.

  • Author
    Posts
  • #75004
    Syl

    Participant
    Points: 6
    Rank: Member

    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

    Keymaster
    Points: 1,624
    Helping HandTeam Member
    Rank: Community Hero

    Have you tried explicitly stating a version when importing it?

  • #75473
    Syl

    Participant
    Points: 6
    Rank: Member

    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!

The topic ‘DSC Resources version question’ is closed to new replies.