Author Posts

April 20, 2017 at 8:54 pm

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

April 21, 2017 at 3:52 pm

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?

April 24, 2017 at 4:08 pm

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

April 26, 2017 at 8:12 am

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}

April 27, 2017 at 7:47 pm

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