Skip to content

Instantly share code, notes, and snippets.

View patelcp's full-sized avatar

Chirag Patel patelcp

View GitHub Profile
@JustinGrote
JustinGrote / Test-AzDOPipeline.ps1
Last active March 6, 2024 12:19
Test Azure Devops Pipeline YAML
function Test-AzDOPipeline {
<#
.SYNOPSIS
Tests an Azure Devops Pipeline YAML configuration
.DESCRIPTION
This can be used to validate an Azure Devops pipeline configuration within a particular pipeline project.
#>
param (
#Your Azure Devops Organization Name
@RosenPetrov
RosenPetrov / Configure-AppPoolAccessToPerformanceMonitoring.ps1
Created June 22, 2018 06:47
PowerShell script for configuring Performance Counters access in Sitecore 9
function IISReset {
[CmdletBinding(SupportsShouldProcess = $true)]
Param
(
[string]$Reason,
[int]$TryNumber = 0,
[switch]$Force
)
if ($Force -or $PSCmdlet.ShouldProcess("IIS", $Reason)) {
@isaadansari
isaadansari / Install-Solr-6.6.2.ps1
Last active October 26, 2019 10:46 — forked from jermdavis/Install-Solr.ps1
A PowerShell script to help installing Solr as a service - See https://jermdavis.wordpress.com/2017/10/30/low-effort-solr-installs/ for details
Param(
$solrVersion = "6.6.2",
$installFolder = "c:\solr",
$solrPort = "8983",
$solrHost = "solr",
$solrSSL = $true,
$nssmVersion = "2.24",
$JREVersion = "9.0.1"
)
@jammykam
jammykam / ShowTitleWhenBlank.cs
Last active August 15, 2017 20:44
Display Field Title alongside default [No text in field] placeholder when value not set - https://ticdevs.com/developers/presentation/page-editor/fixing-blank-fields - Thanks for @nshack31 for the find
using Sitecore.Pipelines.RenderField;
namespace MyProject.CMS.Custom.Pipelines.RenderField
{
public class ShowTitleWhenBlank
{
public void Process(RenderFieldArgs args)
{
args.RenderParameters["show-title-when-blank"] = "true";
}
@jammykam
jammykam / Generate Anti-Update Rollback.ps1
Created January 24, 2017 09:39
Sitecore PowerShell script to generate an anti-update package as a TDS Post Deploy Script - http://wp.me/p2SmN4-fh
$tempFolder = [Sitecore.Update.Utils.FileUtils]::InstallationHistoryRoot
$historyFolder = [Sitecore.MainUtil]::MapPath($tempFolder)
#get the latest update folder
$latestUpdate = Get-ChildItem -Path $historyFolder | Sort-Object LastAccessTime -Descending | Select-Object -First 1
Write-Host $latestUpdate.FullName
[Sitecore.Update.Engine.PackageGenerator]::ConvertRollbackPackage( `
$latestUpdate.FullName + "\rollbackPackage.rlb", `
$latestUpdate.FullName + "\rollbackPackage.update")
@jammykam
jammykam / StringExtensions.tt
Created February 3, 2015 23:30
Hedgehog CodeGen - Glass Mapper v3
<#+
public static string TitleCase(string word)
{
string newWord = System.Text.RegularExpressions.Regex.Replace(word, "([a-z](?=[A-Z])|[A-Z](?=[A-Z][a-z]))", "$1+");
newWord = System.Globalization.CultureInfo.InvariantCulture.TextInfo.ToTitleCase(newWord);
newWord = newWord.Replace("+", "");
return newWord;
}
public static string CamelCase(string word)
@jammykam
jammykam / SwitchingLinkProvider
Last active September 21, 2017 02:57
Sitecore Site Specific Link Provider for up to SC 8.1
using System;
using System.Collections.Specialized;
using System.Web;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Links;
using Sitecore.Web;
namespace Sitecore.Custom.Links