Skip to content

Instantly share code, notes, and snippets.

$location = "C:\inetpub\wwwroot\ca.demo.com\App_Data\TDSDeploy";
$siteName = "ca.demo.com";
Start-Process powershell.exe -ArgumentList "-file $location\UPMC_WebDeploy.ps1", "-PackagePath $location\UPMC.Deploy.TDS.wdp.zip","-MSDeployAllowUntrusted","-SiteName $siteName", "-ComputerName 127.0.0.1", "-Username msdeployuser", "-Password yourpass123", "-AuthType Basic"
#Varibales defined in Octopus
$location = $OctopusParameters["TDSDeployDirectory"];
$siteName = $OctopusParameters["SiteName"];
Start-Process powershell.exe -ArgumentList "-file $location\TDS_WebDeploy.ps1", "-PackagePath $location\Demo.Deploy.TDS.wdp.zip","-MSDeployAllowUntrusted","-SiteName $siteName", "-ComputerName 127.0.0.1", "-Username msdeployuser", "-Password yourpassword123", "-AuthType Basic"
@bala-one
bala-one / ExperienceFormsExportFix.sql
Created December 14, 2020 19:20
Experience Forms Export Fix
CREATE NONCLUSTERED INDEX [IX_FormItemID]
ON [dbo].[FormEntry] ( [formitemid] ASC )
WITH (pad_index = OFF, statistics_norecompute = OFF, sort_in_tempdb = OFF,
drop_existing = OFF, online = OFF, allow_row_locks = ON, allow_page_locks = ON)
ON [PRIMARY]
go
CREATE NONCLUSTERED INDEX [IX_Created]
ON [dbo].[FormEntry] ( [created] ASC )
// Sitecore.ExperienceForms.Mvc.Html.ScriptsExtension
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Web;
using System.Web.Mvc;
private static IHtmlString RenderFiles(HtmlHelper htmlHelper, bool scripts)
{
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
// Sitecore.ExperienceForms.Mvc.Pipelines.RenderForm.IncludeFiles
using Sitecore.Diagnostics;
using System.Collections.Generic;
using System.Web;
protected virtual void IncludePath(HttpContextBase httpContext, string filePath, bool script)
{
Assert.ArgumentNotNull(httpContext, "httpContext");
Assert.ArgumentNotNullOrEmpty(filePath, "filePath");
string key = script ? "ExperienceFormsScriptsKey" : "ExperienceFormsStylesKey";
@bala-one
bala-one / Forms.cshtml
Last active November 18, 2020 04:34
Custom Sitecore Experience Forms view
@using Sitecore.ExperienceForms.Mvc.Constants
@using Sitecore.ExperienceForms.Mvc.Html
@model Sitecore.ExperienceForms.Mvc.Models.FormViewModel
@{
using (Html.BeginRenderRouteForm(Model, IsPost))
{
//The render form scripts OOB feature is not used and the following implementation is used instead
@*@Html.RenderFormScripts()*@
string key = "IsSCFormInitialized";
@bala-one
bala-one / Install_IIS_Brotli.ps1
Created October 7, 2020 03:05
Install Brotli Compression on IIS for Sitecore Performance
net stop was /y
"==========================="
" Intall Compression Module"
"==========================="
msiexec /I iiscompression_amd64.msi /quiet
"=========================="
" Intall Brotli Force rule"
"=========================="
$filter = @{
pspath = 'MACHINE/WEBROOT/APPHOST'
@bala-one
bala-one / Media.TTL.Config
Last active October 7, 2020 03:02
Sitecore Media Library TTL Custom Config
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<!--
The max-age to use in media response headers.
-->
<setting name="MediaResponse.MaxAge">
<patch:attribute name="value">30.00:00:00</patch:attribute>
</setting>
</settings>
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<scheduling>
<agent type="Sitecore.Tasks.CleanupAgent" method="Run" interval="04:00:00">
<files hint="raw:AddCommand">
<!-- Device Detection db needs to be cleared every month -->
<remove folder="/App_Data/DeviceDetection" pattern="*.db" maxAge="35.00:00:00" />
</files>
</agent>