xWebSite DSC Resource related question

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of Aurimas N. Aurimas N. 11 hours, 16 minutes ago.

  • Author
    Posts
  • #69105
    Profile photo of Michael
    Michael
    Participant

    Hi All,

    I setup my site using xWebsite DSC resource. I gave it a place holder value for PhysicalPath key until I deploy code to it. When I deploy applications the physical path will change always as we break it down by version number (i.e. C:\TestWebsite\\Code). However anytime the DSC service reruns its .mof the physical path gets overwritten back to "C:\TestSite." Now I am sure that is intended and should be expected, but if I am not using DSC as a deployment tool for my code is there some form of an override the Physical Path? Kind of like a MatchSource find in the File DSC Resource? Or can this key accept a scriptblock where I can then write some PS to Select the last modified folder within a specific directory?

    Thoughts? Ideas? Suggestions?

            xWebsite TestSite 
    {
                Ensure = 'Present'
                Name = TestSite
                PhysicalPath = "C:\TestWebsite"
                State = 'Started'
                ApplicationPool = TestSiteAppPool
    }
    

    Thanks,
    Michael

  • #69183
    Profile photo of Dakota Clark
    Dakota Clark
    Participant

    Could you explain more in depth on how you are trying to update PhysicalPath? With the code as it is PhysicalPath will always revert to "C:\TestWebsite".

    Have you considered placing a parameter in the DSC configuration that will be used to set the PhysicalPath?

  • #69409
    Profile photo of Michael
    Michael
    Participant

    Hi Dakota,

    Yes. I have considered the option of passing in a value for the Physical Path, but that will not resolve my issue. You confirmed my assumption by stating "With the code as it is PhyiscalPath ...", so I have to think of a different way to implement this.

    Thank you,
    Michael

  • #69531
    Profile photo of Aurimas N.
    Aurimas N.
    Participant

    maybe you could do something like this:

            xWebsite TestSite 
    {
                Ensure = 'Present'
                Name = TestSite
                PhysicalPath = $PhysicalPath
                State = 'Started'
                ApplicationPool = TestSiteAppPool
    }
    $PhysicalPath = {your code to select correct folder}
    

You must be logged in to reply to this topic.