Skip to content

Instantly share code, notes, and snippets.

View nehemiahj's full-sized avatar

Nehemiah Jeyakumar nehemiahj

View GitHub Profile
@nehemiahj
nehemiahj / createEnvironment.ps1
Created September 26, 2023 14:42
Sitecore XM Cloud CLI Create Environment
dotnet sitecore cloud environment create --project-id 6SDCOMzUNvisr41c86Q7fD --name "DEV"
@nehemiahj
nehemiahj / createProject.ps1
Created September 26, 2023 14:41
Sitecore XM Cloud Create Project
dotnet sitecore cloud project create --name Nehem
@nehemiahj
nehemiahj / login.ps1
Created September 26, 2023 14:38
Sitecore XM Cloud CLI Login
dotnet sitecore cloud login --allow-write
@nehemiahj
nehemiahj / Push to Target Environment.ps1
Created September 11, 2023 20:20
Push Content to Target Environment
dotnet sitecore serialization push -i Content -n dev
@nehemiahj
nehemiahj / pullContent.ps1
Created September 11, 2023 20:20
Pull Content
dotnet sitecore serialization pull -i Content -n prod
@nehemiahj
nehemiahj / content.module.json
Created September 11, 2023 20:05
Content Module JSON with specific targets
{
"$schema": "../../.sitecore/schemas/ModuleFile.schema.json",
"namespace": "Content",
"items": {
"includes": [
{
"name": "Pages",
"path": "/sitecore/content/samplesite/samplesite/Home",
"scope": "ItemAndDescendants"
},
@nehemiahj
nehemiahj / connectToXMCloudEnvironment.ps1
Last active September 11, 2023 20:10
To Connect to XM Cloud Environments
# Connec to PROD Environment
dotnet sitecore cloud environment connect --environment-id 1rg2Cn4Nz9HlMvJDoMlp0R --allow-write
# Connec to DEV Environment
dotnet sitecore cloud environment connect --environment-id 5uQrDqtEeitxTlNdOCTmwM --allow-write
@nehemiahj
nehemiahj / openXMCloudPagesFromContentEditor.ps1
Last active September 7, 2023 02:57
To enable content authors to open XM Cloud Pages from Content Editor
Import-Function Get-SiteItem
$item = Get-Item .
$site = Get-SiteItem $item
$title = "Tools"
$text = "To edit in Pages, please click <a href='https://pages.sitecorecloud.io/composer/pages/editor?sc_itemid=$($item.ID)&sc_lang=$($item.Language.Name)&sc_version=$($item.Version.Number)&sc_site=$($site.Name)' target='_blank'>here</a>"
$pipelineArgs.Add($title, $text);
$warning = $pipelineArgs.Warnings[0]
@nehemiahj
nehemiahj / getLatestDeploymentStatus.ps1
Created August 25, 2023 20:37
XM Cloud Retrieve Latest Deployment Status
<#
.SYNOPSIS
Get the status of latest XM Cloud Deployment in an environment
.NOTES
NEHEMIAH JEYAKUMAR
#>
# !!! SENSITTIVE INFORMATION !!!
# Store it in Encrypted Connection String and retrieve it or Key Vault
@nehemiahj
nehemiahj / XM Cloud Deploy Status Field Mapping.md
Created August 25, 2023 18:57
XM Cloud Deploy Status Field Mapping
Status Explanation
0 NotStarted
1 InProgress
2 Complete
3 Failed