anchor.diff:  	echo %value% INFO - Removed the %%i directory from %pathToJaggeryapps%
   )
   goto finishOptimization
  -
  -:disableDataPublisher
  -for /f %%i in ('powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.DataPublisher.Enabled;"') do (
  -	if %%i==true (
  -		powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.DataPublisher.Enabled='false'; $xml.Save('%pathToApiManagerXML%');"
  -		call :Timestamp value
  -		echo %value% INFO - Disabled the ^<DataPublisher^> from api-manager.xml file
  -	)
  -)
  -EXIT /B 0
  -
  -:disableJMSConnectionDetails
  -for /f %%i in ('powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.JMSConnectionDetails.Enabled;"') do (
  -	if %%i==true (
  -		powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.JMSConnectionDetails.Enabled='false'; $xml.Save('%pathToApiManagerXML%');"
  -		call :Timestamp value
  -		echo %value% INFO - Disabled the ^<JMSConnectionDetails^> from api-manager.xml file
  -	)
  -)
  -EXIT /B 0
  -
  -:disablePolicyDeployer
  -for /f %%i in ('powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.PolicyDeployer.Enabled;"') do (
  -	if %%i==true (
  -		powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.PolicyDeployer.Enabled='false'; $xml.Save('%pathToApiManagerXML%');"
  -		call :Timestamp value
  -		echo %value% INFO - Disabled the ^<PolicyDeployer^> from api-manager.xml file
  -	)
  -)
  -EXIT /B 0
  -
  -:disableBlockConditionRetriever
  -for /f %%i in ('powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.BlockCondition.Enabled;"') do (
  -	if %%i==true (
  -		powershell -Command "$xml = [xml] (Get-Content %pathToApiManagerXML%); $xml.APIManager.ThrottlingConfigurations.BlockCondition.Enabled='false'; $xml.Save('%pathToApiManagerXML%');"
  -		call :Timestamp value
  -		echo %value% INFO - Disabled the ^<BlockCondition^> from api-manager.xml file
  -	)
  -)
  -EXIT /B 0
  -
  -:disableTransportSenderWS
  -for /f %%i in ('powershell -Command "& {$xml = [xml] (Get-Content %pathToAxis2XML%); $xml.selectSingleNode('//transportSender[@name=\"ws\"]'); }" ') do (
  -	powershell -Command "& { $xml = [xml] (Get-Content %pathToAxis2XML%); $xml.selectNodes('//transportSender[@name=\"ws\"]') | ForEach-Object { $node = $_; $comment = $xml.CreateComment($node.OuterXml); $node=$node.ParentNode.ReplaceChild($comment, $node);}; $xml.Save('%pathToAxis2XML%');}"
  -	call :Timestamp value
  -	echo %value% INFO - Disabled the ^<transportSender name="ws" class="org.wso2.carbon.websocket.transport.WebsocketTransportSender"^> from axis2.xml file
  -	goto skipLoop1
  -)
  -:skipLoop1
  -EXIT /B 0
  -
  -:disableTransportSenderWSS
  -for /f %%i in ('powershell -Command "& {$xml = [xml] (Get-Content %pathToAxis2XML%); $xml.SelectSingleNode('//transportSender[@name=\"wss\"]'); }" ') do (
  -	powershell -Command "& { $xml = [xml] (Get-Content %pathToAxis2XML%); $xml.selectNodes('//transportSender[@name=\"wss\"]') | ForEach-Object { $node = $_; $comment = $xml.CreateComment($node.OuterXml); $node=$node.ParentNode.ReplaceChild($comment, $node);}; $xml.Save('%pathToAxis2XML%');}"
  -	call :Timestamp value
  -	echo %value% INFO - Disabled the ^<transportSender name="wss" class="org.wso2.carbon.websocket.transport.WebsocketTransportSender"^> from axis2.xml file
  -	goto skipLoop2
  -	)
  -:skipLoop2
  -EXIT /B 0
  -
  -:disableIndexingConfiguration
  -for /f %%i in ('powershell -Command "$xml = [xml] (Get-Content %pathToRegistry%); $xml.wso2registry.indexingConfiguration.startIndexing;"') do (
  -	if %%i==true (
  -		powershell -Command "$xml = [xml] (Get-Content %pathToRegistry%); $xml.wso2registry.indexingConfiguration.startIndexing='false'; $xml.Save('%pathToRegistry%');"
  -		call :Timestamp value
  -		echo %value% INFO - Disabled the ^<indexingConfiguration^> from registry.xml file
  -	)
  -)
  -EXIT /B 0
   
   :removeWebSocketInboundEndpoint
   if exist %pathToInboundEndpoints%\WebSocketInboundEndpoint.xml (
  
positive.code:         ren %pathToRegistryTemplate% %registryBackupTemplate%
          call :Timestamp value
          echo %value% INFO - Rename the existing %pathToRegistryTemplate% file as %registryBackupTemplate%
          ren  %pathToRegistryTM% %registryXMLTemplate%
          call :Timestamp value
          echo %value% INFO - Rename the existing %pathToRegistryTMTemplate% file as %registryXMLTemplate%
  	)
  
negative.code: 
  :gatewayWorker
  echo Starting to optimize API Manager for the Gateway worker profile
  rem ---removing webbapps which are not required for this profile--------
  for /f %%i in ('dir %pathToWebapps% /b ^| findstr /v "am#sample#pizzashack#v.*war"') do (
  	del /f %pathToWebapps%\%%i
  