Clone wiki

sitecore-automation / sitecore-config

A few methods to manipulate Sitecore configuration files and web.config file.

  • New-IISHandler - adds a new handler
  • Remove-IISHandler - removes a handler with given name
  • Disable-IISHandler - comments out a handler with given name

IIS Handlers

A function New-IISHandler adds a new handler to handlers section in web.config

New-IISHandler -XmlPath $path -Name "CaptchaImage" -Path 'CaptchaImage.axd' -Type "Sitecore.Form.Core.Pipeline.RequestProcessor.CaptchaResolver, Sitecore.Forms.Core" -Verb "*" -Verbose
New-IISHandler -Comment "WFFM handler" -XmlPath $path -Name "CaptchaAudio" -Path 'CaptchaAudio.axd' -Type "Sitecore.Form.Core.Pipeline.RequestProcessor.CaptchaResolver, Sitecore.Forms.Core" -Verb "*" -Verbose 

new-iishandler.png

A function Remove-IISHandler removes a handler with given name from handlers section in web.config

Remove-IISHandler -XmlPath $path -Name "CaptchaAudio" -Verbose

remove-iishandler.png

A function Disable-IISHandler comments out a handler with given name from handlers section in web.config

Disable-IISHandler -XmlPath $path -Name "WebDAVRoot" -Verbose

disable-iishandler.png

Sitecore settings patch

Updated