This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GraphQL.Types; | |
using Sitecore.ContentSearch; | |
using Sitecore.ContentSearch.Linq; | |
using Sitecore.ContentSearch.Linq.Utilities; | |
using Sitecore.ContentSearch.Utilities; | |
using Sitecore.Data; | |
using Sitecore.Data.Managers; | |
using Sitecore.Globalization; | |
using Sitecore.Services.GraphQL.Content.GraphTypes.ContentSearch; | |
using Sitecore.Services.GraphQL.GraphTypes.Connections; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############ | |
# Author: Rich Rosiak | |
# | |
# This script gets all images for a given content location in language en | |
# | |
# Function ZipItems copied from item: | |
# /sitecore/system/Modules/PowerShell/Script Library/SPE/Maintenance/Media Library Maintenance/Content Editor/Context Menu/Download | |
# and then customized | |
############ | |
function ZipItems( $zipArchive, $items ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
/** | |
* Fetch and log a request | |
* @param {Request} request | |
*/ | |
async function handleRequest(request) { | |
// Parse request URL to get access to query string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$registry = "%registry name here, i.e. myregistry%" | |
$repositories = docker images --digests | % { $_ -replace " +", "," } | convertfrom-csv | where { $_.REPOSITORY.StartsWith($registry) } | group REPOSITORY | |
Write-Output "Found $($repositories.Count) local repositories from $($registry) registry" | |
foreach ($group in $repositories) { | |
$repository = $group.Name.Split('/')[1] | |
$remoteData = az acr repository show-tags -n $registry --repository $repository --detail | convertfrom-json | |
foreach ($localRepo in $group.Group) { | |
$localRepo | Add-Member -NotePropertyName REPO -NotePropertyValue $repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function prompt { | |
$location = $executionContext.SessionState.Path.CurrentLocation.path | |
#what is the maximum length of the path before you begin truncating? | |
$len = 33 | |
if ($location.length -gt $len) { | |
#split on the path delimiter which might be different on non-Windows platforms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[string] $path | |
) | |
function Expand-Tokens{ | |
param( | |
[string] $configName, | |
[string] $path | |
) | |
$root = $configName.Split(".") | |
if ($root.Length -ge 1){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ClearEdgeCacheHandler | |
{ | |
private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | |
private const string LastUpdateTimeKey = "ItemsPublishedEventHandler_LastUpdateTimeKey"; | |
public void ItemsPublished(object sender, EventArgs args) | |
{ | |
var now = DateTime.UtcNow; | |
var database = Factory.GetDatabase("web"); | |
var fromDate = database.PropertyStore.GetDateValue(LastUpdateTimeKey, DateTime.MinValue.ToUniversalTime()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CacheControlProcessor : CacheControl | |
{ | |
protected override void RunCacheControl(ActionExecutedArgs args) | |
{ | |
Assert.IsNotNull(args, "args != null"); | |
if (Sitecore.Context.Item != null) | |
{ | |
if (HasRequestMethodGet(args) && DoesntHaveQuerystrings(args)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to set up Unicorn in your Docker container | |
Since all writing to Unicorn files happens inside the container, and the container is now linked to .\unicorn, | |
all you need to do is ensure that .\unicorn is included under source control. | |
This gets even better if you use Transparent Sync. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Lists the items with broken links searching all or the latest version in the current language. | |
This is an update of the original Broken Links report created by the authors of SPE: | |
https://github.com/SitecorePowerShell/Console | |
This versions has the following changes | |
* Ability to ignore checking broken links in the renderings field. (Makes sense in come clone scenarios) | |
* Supports checking external links of field type "General Link with Search" | |
* Supports checking external protocol independent links (URL's starting with //) |