Octopus Offline deploy, IIS webapplication physical path not adjusted

Hi Octopus,
We are developing an Offline Deploy Package. In this package a new webapplication is deployed on a certain location. After that the physical path of the current webapplication has to be adjusted to the path of the newly deployed webapplication. In the deploy.ps1 the following powershell script is executed:
Set-ItemProperty $appPath -name physicalPath -value $webRoot
The $appPath and $webRoot are filed with the right values which is checked by the Write-Host command.
Still the physical path is not adjusted, but I can’t figure out why. Can you help me?

Kind regards,

Marijn Ophelders

Hi Marjin

Thanks for keeping in touch. Octopus has a build in step Deploy to IIS which is good for website deployment, would you consider using it? you can find more information from this link https://octopus.com/docs/deploying-applications/iis-websites-and-application-pools


Hi Eddy,
Thanks for the quick response. I already found a solution for the problem I mentioned. It turned out that the variable I used for the physicalPath value ($webRoot) was an object, despite the fact that the correct path was printed when I used the Write-Host $webRoot command. So this confused me.
Kind regards,

Marijn Ophelders