xWebSite DSC Resource related question

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

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?

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

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}

Hi,

Yes that would pass in the current path, but the code path that the site runs can change with a new version anytime within the day. Which means I would have to deploy my new code and my DSC code with the latest path everytime it changes. That would cause unnecessary work.

That is why I was hoping the xWebsite DSC resource would only setup the site with the Physical path the first time and then each time the DSC runs it only confirms that the site is running, not worry about what path it is pointing to.

Thank you for the info.
-Michael