This file contains hidden or 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
# Create a list of field names on the Standard Template. This will help us filter out extraneous fields. | |
$standardTemplate = Get-Item -Path "master:" -ID ([Sitecore.TemplateIDs]::StandardTemplate.ToString()) | |
$standardTemplateTemplateItem = [Sitecore.Data.Items.TemplateItem]$standardTemplate | |
$standardFields = $standardTemplateTemplateItem.OwnFields + $standardTemplateTemplateItem.Fields | Select-Object -ExpandProperty key -Unique | |
# Change the Id to something other than the Sample Item template. | |
$itemTemplate = Get-Item -Path "master:" -ID "{76036F5E-CBCE-46D1-AF0A-4143F9B557AA}" | |
$itemTemplateTemplateItem = [Sitecore.Data.Items.TemplateItem]$itemTemplate | |
$itemTemplateFields = $itemTemplateTemplateItem.OwnFields + $itemTemplateTemplateItem.Fields | Select-Object -ExpandProperty key -Unique |
This file contains hidden or 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
$TemplateID = "{guid}" | |
# Create a list of field names on the Standard Template. This will help us filter out extraneous fields. | |
$standardTemplate = Get-Item -Path "master:" -ID ([Sitecore.TemplateIDs]::StandardTemplate.ToString()) | |
$standardTemplateTemplateItem = [Sitecore.Data.Items.TemplateItem]$standardTemplate | |
$standardFields = $standardTemplateTemplateItem.OwnFields + $standardTemplateTemplateItem.Fields | Select-Object -ExpandProperty key -Unique | |
# Change the Id to something other than the Sample Item template. | |
$itemTemplate = Get-Item -Path "master:" -ID $TemplateID | |
$itemTemplateTemplateItem = [Sitecore.Data.Items.TemplateItem]$itemTemplate |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
Update Workflow and Workflow state of content items which have no workflow set while their templates have the Default workflow field set. | |
.DESCRIPTION | |
This script can be used when existing content is not assigned to a workflow and workflow state while it should be. | |
This scenario usually occurs when a workflow is assigned to a template but there is already content created based on a previous version of that template (where the workflow was not yet assigned). |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
Validates a Sitecore "Assembly list" (from dev.sitecore.net) against a folder | |
.PARAMETER AssemblyList | |
The assembly list text file downloaded from dev.sitecore.net | |
.PARAMETER AssemblyFolder | |
The folder containing the Sitecore assemblies to validate | |
.PARAMETER CheckFileVersion | |
If set, also verifies the file version. Requires loading the assembly, so should be invoked in an isolated powershell environment | |
.NOTES |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
Runs a clean up for each database. | |
.NOTES | |
Michael West | |
#> | |
foreach($database in Get-Database) { | |
if(!$database.ReadOnly) { |
This file contains hidden or 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
$response = Show-ModalDialog -HandleParameters @{ | |
"h"="Create an Anti-Package"; | |
"t" = "Select a package that needs an anti-package"; | |
"ic"="People/16x16/box.png"; | |
"ok"="Pick"; | |
"ask"=""; | |
"path"= "packPath:$SitecorePackageFolder"; | |
"mask"="*.zip"; | |
} -Control "Installer.Browse" |
This file contains hidden or 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
$processedItems = New-Object System.Collections.ArrayList | |
function SetWorkFlowAndState { | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$true)] | |
[Sitecore.Data.Items.Item]$Item, | |
[Parameter(Mandatory=$true)] | |
[Sitecore.Data.ID]$WorkflowID, | |
[Parameter(Mandatory=$true)] |
This file contains hidden or 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
$startDate = [datetime]"02/24/2016" | |
$days = ([datetime]::today - $startDate).Days | |
Get-ChildItem master:\content\home -Recurse | | |
? { $_."__updated" -gt (Get-Date).AddDays(-$days) } | | |
Where-Object { "Resource Reference","Sitemap","AddOns","Market Generic Page" -notcontains $_.TemplateName } | | |
Select-Object -Property ID, Name, "__updated", "__updated by", "TemplateName" | | |
Export-Csv -Path "$($SitecoreDataFolder)\page-changes.csv" | |
This file contains hidden or 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-Module -Name SPE | |
$session = New-ScriptSession -Username admin -Password b -ConnectionUri http://console | |
$bytes = Invoke-RemoteScript -Session $session -ScriptBlock { | |
[System.IO.File]::ReadAllBytes("$($SitecoreDataFolder)packages\SPE Remoting-3.1.zip") | |
} | |
[System.IO.File]::WriteAllBytes("C:\temp\SPE Remoting-3.1.zip", $bytes) |
This file contains hidden or 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
Get-SearchIndex | Rebuild-SearchIndex -IncludeRemoteIndex | |
$jobs = [Sitecore.Jobs.JobManager]::GetJobs() | Where-Object { !$_.IsDone -and $_.Category -eq "Indexing" } | Sort-Object -Property Name | |
$jobsCount = $jobs.Count | |
while(($jobs | Where-Object { !$_.IsDone })) { | |
$progressCount = 0 | |
$message = New-Object System.Text.StringBuilder | |
foreach($job in $jobs) { | |
$message.AppendLine("$($job.Name) is $($job.Status.State) and processed: $($job.Status.Processed)") | Out-Null |
NewerOlder