Start/Stop IIS

How would you go about stopping IIS during a deploy and starting it again when done? We’ve got some issues with IIS randomly locking files and causing deployments to fail.

Including powershell scripts in your package with the names PreDeploy.ps1, Deplooy.ps1 and/or PostDeploy.ps1 will be executed during the deployment proces as laid out here:

Using powershell Cmdlets you can easily achieve want you’re looking to do. See a list here:

for example:

Stop-Website -Name $myWebSite