Skip to content

Instantly share code, notes, and snippets.

@derekcorreia
derekcorreia / SCSPFix.ps1
Last active January 23, 2020 15:38
Fixes Sitecore Support Package generator config sets when generated with multiple servers. Replace $source with a "Configs" directory containing ".link" files after un-archiving the SSP. Run from Powershell console.
# Change source to match path of folder from support package with .link files that won't build in config builder
# Source folder should have a web.config or web.config.link, and the app_config folder below it.
$source = "C:\SupportPackage\INSTANCE-Sitecore-prd-cd\Configs"
Write-Host "Fix Sitecore Support Package Links"
Write-Host "Source Directory defined in .ps1: " -NoNewline
Write-Host $source -ForegroundColor Yellow
Write-Host "Confirm path and press any key to begin. Press Ctrl-C to exit"
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
@AdamNaj
AdamNaj / Add-ProjectSpecificComponentDatasource.ps1
Last active September 29, 2017 17:06
Create project specific datasource templates for your SXA tenant so you can extend them with custom fields - Promo on Showcase example
###### user settings start here
# Path to the tenant that you want to update
$tenantTemplatesPath = "master:\templates\Project\Showcase"
# Site that should be upgraded to the new template - ise asterisk to upgrade multiple sites.
$sitePath = "master:\content\Showcase\*"
# Path to the component for which you want to introduce your own data source
$componentPath = 'master:\layout\Renderings\Feature\Experience Accelerator\Page Content\Promo'
@kamsar
kamsar / Install Solr.ps1
Last active February 26, 2019 14:30
Sitecore Solr Cannon
# This script will set up (and install if needed) Apache Solr for a Sitecore instance.
# This does NOT configure Sitecore to use Solr,
# just the Solr server and cores for Sitecore to connect to once it is set up to use Solr.
# So, what does it do?
#
# * Installs SOLR, if needed, from the Bitnami SOLR stack: https://bitnami.com/stack/solr/installer
# * Creates a SOLR config set for the cores to share (shared schema)
# * Creates SOLR cores for all Sitecore indexes, including secondary cores to support online reindexing (Switch on Rebuild)
@michaellwest
michaellwest / UnusedMediaItems.ps1
Last active October 21, 2022 14:09
Sitecore PowerShell script to locate media items without reference to any other item.
<#
.SYNOPSIS
Lists all media items that are not linked to other items.
.NOTES
Michael West
#>
# HasReference determines if the specified item is referenced by any other item.
function HasReference {
@seankearney
seankearney / Sitecore-IFilters.aspx
Last active November 12, 2016 02:08
Simple Sitecore/ASP.NET page to check what IFilters are known to the Sitecore system. It will also attempt to locate a media library item of each type and read text out of that file. This should help troubleshoot why some content inside of media library items are not being indexed.
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
// These are the extensions that Sitecore 7 supports indexing content for
// See: Sitecore.ContentSearch.ComputedFields.MediaItemContentExtractor
string[] extensions = new[]{ ".pdf",
".html",
".rtf",