This repository has been archived by the owner on Jan 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSample.ps1
38 lines (32 loc) · 1.54 KB
/
Sample.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$ScriptPath = Split-Path $MyInvocation.MyCommand.Path
$MicroCHAP = $ScriptPath + '\MicroCHAP.dll'
$publishPayload = @{
"ItemId" = ""
"IncludeDescendantItems" = $true
"IncludeRelatedItems" = $true
"Languages" = @(@{"Code" = "en"; "DisplayName" = "English"})
"Targets" = @(@{"Id" = "Internet"; "Name" = "Internet"})
"sourceDatabase" = "master"
} | ConvertTo-Json
$publishPayloadAll = @{
"ItemId" = "{11111111-1111-1111-1111-111111111111}"
"IncludeDescendantItems" = $true
"SyncWithTarget" = $false
"Languages" = @(@{"Code" = "en"; "DisplayName" = "English"})
"Targets" = @(@{"Id" = "Internet"; "Name" = "Internet"})
"sourceDatabase" = "master"
"metadata" = @{
"Publish.Options.ClearAllCaches" = $false
"Publish.Options.Republish" = $false
}
} | ConvertTo-Json
$secret = "Patch-This-Value-With-Something-Other-Than-This"
$instanceUrl = "https://scms.dev.sc.local" # Replace with your site Url
Write-Host "Publishing the site" -ForegroundColor Yellow
$publishUrl = "$($instanceUrl)/sitecore/api/ssc/publishing/jobs/0/FullPublish"
$challenge = Get-SscChallenge -InstanceUrl $instanceUrl
Invoke-SscRequest -Url $publishUrl -SharedSecret $secret -Challenge $challenge -Payload $publishPayload | ConvertFrom-Json
Write-Host "Getting the home item" -ForegroundColor Yellow
$challenge = Get-SscChallenge -InstanceUrl $instanceUrl
$query = $instanceUrl + "/sitecore/api/ssc/item/{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}"
Get-SscResult -Url $query -SharedSecret $secret -Challenge $challenge | ConvertFrom-Json