Skip to content

Instantly share code, notes, and snippets.

@ankitjoshi
Last active May 29, 2021 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitjoshi/467c8745cb2c3545159e517b5084918d to your computer and use it in GitHub Desktop.
Save ankitjoshi/467c8745cb2c3545159e517b5084918d to your computer and use it in GitHub Desktop.
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
)
begin {
Write-Verbose "Cmdlet Invoke-ModuleScriptBody - Begin"
}
process {
Write-Verbose "Cmdlet Invoke-ModuleScriptBody - Process"
$dictionaryDomain = Get-DictionaryDomain $Site
$dictionaryDomainPath=$dictionaryDomain.Paths.Path
$dictionaryDomainItem= Get-Item -Path $dictionaryDomainPath
# dictionary branch template Id...
$templateId = "{BC8C810C-ACAC-4C40-9A37-036BC6B2B93D}"
New-Item -Parent $dictionaryDomainItem -Name "TestModuleDictionary" -ItemType $templateId
}
end {
Write-Verbose "Cmdlet Invoke-ModuleScriptBody - End"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment