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
# http://jockstothecore.com/content-import-with-powershell-treasure-hunt | |
function NormalizeName($name) | |
{ | |
# replace all special symbols with single spaces | |
$name = $name -replace "[^a-zA-Z0-9]", " " -replace "\s+", "" | |
return $name.Trim() | |
} |
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
$item = get-item master:\content\Demo\Int\Home | |
$device =Get-Device -Default | |
$contentDataSource = get-item master:\content\Demo\Int\Home\about-us\employee-stories\adam-najmanowicz | |
$ImageDataSource = get-item master:\content\Demo\Int\Data\Images\d56cf7e777a2496aa6489a7bffc03539 | |
$rendering = get-item master:\layout\Sublayouts\ZenGarden\Basic\Content | |
Add-Rendering -Item $item -Device $device -Rendering $rendering -Placeholder main -Parameter @{FieldName ="Title"} -DataSource $contentDataSource | |
$rendering = get-item master:\layout\Sublayouts\ZenGarden\Basic\Image | |
Add-Rendering -Item $item -Device $device -Rendering $rendering -Placeholder main -DataSource $ImageDataSource | |
$rendering = get-item master:\layout\Sublayouts\ZenGarden\Basic\Subtitle |
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 | |
Data Import Wizard provides a way to generate or update content from an external file. | |
.DESCRIPTION | |
The import file uses the properties "Name" and "Id" to help match existing items. | |
.NOTES | |
Requires Sitecore PowerShell Extensions 4.6 or newer. | |
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
<# | |
Author(s): Bruce Lee, Grant Killian, Kelly Rusk, Jimmy Rudley | |
Created Date: August 4, 2016 | |
Modified Date: May 3, 2017 | |
This is the Rackspace Managed Services for Sitecore (https://www.rackspace.com/digital/sitecore) script for security hardening a Sitecore environment | |
If the Execution Policy does not allow execution, you may need to run the following interactively to allow a scoped session bypass. | |
This is secure as it requires interaction on server and cannot be executed from a script: |
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 |
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
$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
$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
$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
<# | |
.SYNOPSIS | |
Runs a clean up for each database. | |
.NOTES | |
Michael West | |
#> | |
foreach($database in Get-Database) { | |
if(!$database.ReadOnly) { |
OlderNewer