Skip to content

Instantly share code, notes, and snippets.

@ankitjoshi
ankitjoshi / Items recently updated by specified USER
Last active November 25, 2021 05:03
Sitecore PSE- Items recently updated by specified USER -- [Extension of Items last updated OOTB PSE report]
$database = "master"
$root = Get-Item -Path (@{$true="$($database):\content\home"; $false="$($database):\content"}[(Test-Path -Path "$($database):\content\home")])
$periodOptions = [ordered]@{Before=1;After=2;}
$maxDaysOptions = [ordered]@{"-- Skip --"=[int]::MaxValue;30=30;90=90;120=120;365=365;}
$settings = @{
Title = "Report Filter"
OkButtonName = "Proceed"
CancelButtonName = "Abort"
Description = "Filter the results for items updated on or after the specified date by specified user."
@ankitjoshi
ankitjoshi / Test-ItemIsDictionaryDomain
Created May 29, 2021 14:42
Search Dictionary domain item script (SXA Add Dictionary Script #3)
function Test-ItemIsDictionaryDomain {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true, ValueFromPipeline = $true, Position=0 )]
[Item]$Item
)
begin {
Write-Verbose "Cmdlet Test-ItemIsDictionaryDomain - Begin"
}
@ankitjoshi
ankitjoshi / Get-DictionaryDomain
Last active May 29, 2021 14:43
Get Site Dictionary Domain Script (SXA Add Dictionary Script #2)
function Get-DictionaryDomain {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true, ValueFromPipeline = $true, Position=0 )]
[Item]$Root
)
begin {
Import-Function Test-ItemIsDictionaryDomain
Write-Verbose "Cmdlet Get-DictionaryDomain - Begin"
@ankitjoshi
ankitjoshi / Add-SXAModuleDictionary
Last active May 29, 2021 14:43
Add Dictionary Item(s) while installing custom Sitecore SXA module to specific site (SXA Add Dictionary Script #1)
Import-Function Get-DictionaryDomain
function Invoke-ModuleScriptBody {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true, Position = 0 )]
[Item]$Site,
[Parameter(Mandatory = $true, Position = 1 )]
[Item[]]$TenantTemplates
@ankitjoshi
ankitjoshi / Content Hub Custom Media Preset
Created October 16, 2020 06:35
Content Hub Custom Media Preset
"presets": [
{
"name": "Demo Preset",
"conversion":[
{
"type":"colorProfile",
"value":"sRGB"
},
{
"type":"fileExtension",
@ankitjoshi
ankitjoshi / Using Config Transforms in your Sitecore Project- Replace
Created October 12, 2020 12:10
Using Config Transforms in your Sitecore Project- Replace
<setting name="MySetting" value="New Value" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
@ankitjoshi
ankitjoshi / Using Config Transforms in your Sitecore Project- Remove
Created October 12, 2020 12:06
Using Config Transforms in your Sitecore Project- Remove
<setting name="MySetting" value="Setting Value" xdt:Transform="Remove" xdt:Locator="Match(name)"/>
@ankitjoshi
ankitjoshi / Using Config Transforms in your Sitecore Project- Insert
Last active October 12, 2020 11:46
Using Config Transforms in your Sitecore Project- Insert
<add name="MySetting" value="Setting Value" xdt:Transform="Insert"/>