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]$LogPath) | |
$db = '' | |
foreach ($line in Get-Content $LogPath) | |
{ | |
if ($line -like '*Cleanup of resource items is started for *') { | |
$db = $line -replace '^.*Cleanup of resource items is started for ''(\w+)'' database.*$', '$1' | |
} | |
if ($line -like '*item {*} is modified.*') { |
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
import axios from "axios" | |
// To use previous step data, pass the `steps` object to the run() function | |
export default defineComponent({ | |
props: { | |
data: {type: "data_store"} | |
}, | |
async run({ steps, $ }) { | |
// Return data to use it in future steps | |
var url = process.env.NGROK_SITECORE_CM_URL; | |
if (url.substr(-1) != '/') url += '/'; |
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 Get-Token { | |
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" | |
$headers.Add("Content-Type", "application/x-www-form-urlencoded") | |
$headers.Add("Accept", "application/json") | |
$body = "password=b&grant_type=password&username=sitecore%5Cadmin&client_id=postman-api&scope=openid%20sitecore.profile%20sitecore.profile.api" | |
$response = Invoke-RestMethod 'https://xm1id.localhost/connect/token' -Method 'POST' -Headers $headers -Body $body | |
$response | ConvertTo-Json |
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
<!-- NOTE: THIS IS A FRAGMENT. INCLUDE THIS IN Sitecore.IdentityServer.Host.xml, in node /Settings/Sitecore/IdentityServer/Clients --> | |
<!-- Postman configuration documented here: https://doc.sitecore.com/xp/en/developers/92/sitecore-experience-commerce/bearer-token-authentication.html --> | |
<PostmanClient> | |
<ClientId>postman-api</ClientId> | |
<ClientName>Postman API</ClientName> | |
<AccessTokenType>0</AccessTokenType> | |
<AllowOfflineAccess>true</AllowOfflineAccess> | |
<AlwaysIncludeUserClaimsInIdToken>false</AlwaysIncludeUserClaimsInIdToken> | |
<AccessTokenLifetimeInSeconds>3600</AccessTokenLifetimeInSeconds> |
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 Get-SitecoreReleaseNotes() | |
{ | |
$links = (invoke-webrequest https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform.aspx).Links | |
$versions = $links |? {$_.innerText -like 'Sitecore Experience Platform*' -and $_.InnerText -notlike '*and below*'} # https://www.howtogeek.com/124736/stupid-geek-tricks-extract-links-off-any-webpage-using-powershell/ | |
$versionlinks = @{} | |
$versions |% { $versionLinks.Add($_.innerHtml, $_.href)} | |
$releaseNotes = @{} | |
$versionLinks.Keys |%{ | |
$releaseNotesUrl = "https://dev.sitecore.net" + ($versionLinks[$_]).Trim(".aspx") + "/Release%20Notes" | |
Write-Verbose $releaseNotesUrl |
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
<%@ Page %> | |
<%@ Import namespace="Sitecore.ContentSearch" %> | |
<%@ Import namespace="Sitecore.ContentSearch.SearchTypes" %> | |
<html> | |
<body> | |
<form runat=server> | |
<!-- <asp:textbox runat=server id=tb1 /> --> | |
<asp:button runat=server text=Click onclick=DoSearch /> | |
<script runat=server> |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/" xmlns:env="http://www.sitecore.net/xmlconfig/env/"> | |
<sitecore > | |
<services> | |
<configurator type="CustomCampaignRepository.ServicesConfigurator, CustomCampaignRepository" /> | |
</services> | |
</sitecore> | |
</configuration> |
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 System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Runtime.CompilerServices; | |
using System.Security; | |
using System.Security.Claims; | |
using System.Security.Cryptography; | |
using System.Security.Cryptography.X509Certificates; | |
using System.Threading; |
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 NSubstitute; | |
using Sitecore.Abstractions; | |
namespace UnitTestingDemo | |
{ | |
internal static class CacheFixture | |
{ | |
public static (CustomCacheFactory, BaseCacheManager, BaseSettings) CreateCache() | |
{ | |
BaseCacheManager cacheManager = Substitute.For<BaseCacheManager>(); |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<parameters> | |
<parameter name="Application Ribbon Home Label" | |
description="Label that appears in ribbon" | |
defaultvalue="Application name" > | |
<parameterEntry kind="TextFile" scope="_Layout.cshtml" match="Application name" /> | |
</parameter> | |
</parameters> |
NewerOlder