This file contains 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
$targetDatabaseFieldId = New-Object Sitecore.Data.ID "{39ECFD90-55D2-49D8-B513-99D15573DE41}" | |
$targets = @() | |
foreach($publishingTarget in [Sitecore.Publishing.PublishManager]::GetPublishingTargets((Get-Database -Name "master"))) { | |
$targets += $publishingTarget[$targetDatabaseFieldId] | |
} | |
$publishingCandidates = Get-ChildItem -Path "master:\content\home" | |
$databases = Get-Database | Where-Object { $targets -contains $_.Name } | |
$relatedItems = @() |
This file contains 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
$source = "C:\inetpub\wwwroot\MySite" | |
Set-Location $source | |
| |
#---------------------- | |
# exclude locations | |
#---------------------- | |
| |
$ignoreFolder = @() | |
$ignoreFolder += "\Website\App_Data" | |
$ignoreFolder += "\Website\temp" |
This file contains 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-Item -Path "master:\media library" | Publish-Item -PublishMode Smart -Recurse | |
function Get-PublishJob { | |
[CmdletBinding(DefaultParameterSetName="All")] | |
param( | |
[Parameter(Mandatory,ParameterSetName="State")] | |
[Sitecore.Jobs.JobState]$State, | |
[Parameter(Mandatory,ParameterSetName="Id")] | |
[string]$Id |
This file contains 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
function Set-SubItemSortOrder { | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory)] | |
[string]$Path, | |
[Parameter(Mandatory,ParameterSetName="SortOrder")] | |
[ValidateSet("Created", "Default", "DisplayName", "Logical", "Reverse", "Updated")] | |
[string]$SortOrder, | |
This file contains 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
function Compare-Folder { | |
param( | |
[string]$LeftFolder, | |
[string]$RightFolder | |
) | |
$LeftSideHash = Get-ChildItem $LeftFolder -Recurse | Get-FileHash -Algorithm SHA1 | | |
Select-Object @{Label="Path";Expression={$_.Path.Replace($LeftFolder,"")}},Hash | |
$RightSideHash = Get-ChildItem $RightFolder -Recurse | Get-FileHash -Algorithm SHA1 | | |
Select-Object @{Label="Path";Expression={$_.Path.Replace($RightFolder,"")}},Hash |
This file contains 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
$user1 = Get-User -Identity michael1 | |
$user2 = Get-User -Identity michael2 -Authenticated | |
$user2.Profile.ProfileItemId = $user1.Profile.ProfileItemId | |
$user2.Profile.Portrait = $user1.Profile.Portrait | |
foreach($customPropertyName in $user1.Profile.GetCustomPropertyNames()) { | |
$customPropertyValue = $user1.Profile.GetCustomProperty($customPropertyName) | |
$user2.Profile.SetCustomProperty($customPropertyName, $customPropertyValue) | |
} |
This file contains 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 | |
Remoting setup | |
.DESCRIPTION | |
The following list describes the key setup requirements to get SPE Remoting working. | |
- Deploy SPE Remoting module | |
- Windows PowerShell Module : SPE Remoting-4.0.zip | |
- Usual Path : C:\Users\micha\Documents\WindowsPowerShell\Modules\SPE |
This file contains 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
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<powershell> | |
<services> | |
<mediaUpload> | |
<patch:attribute name="enabled">true</patch:attribute> | |
</mediaUpload> | |
<fileDownload> | |
<patch:attribute name="enabled">true</patch:attribute> | |
</fileDownload> |
This file contains 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
foreach($node in [Sitecore.Configuration.Factory]::GetConfigNodes("scheduling/agent") | Where-Object { $_.Type -like "*CleanupPublishQueue*" -or $_.Type -like "*CleanupEventQueue*" -or $_.Type -like "*CleanupHistory*"}) { | |
$obj = [Sitecore.Configuration.Factory]::CreateObject($node, $true) | |
$name = [Sitecore.Xml.XmlUtil]::GetAttribute("type", $node) | |
$method = [Sitecore.Xml.XmlUtil]::GetAttribute("method", $node) | |
$options = New-Object Sitecore.Jobs.JobOptions $name, "", "", $obj, $method | |
$options.AtomicExecution = $true | |
$options.SiteName = "website" | |
[Sitecore.Jobs.JobManager]::Start($options) | |
} |
This file contains 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
var orig = jQuery.fn.hide; | |
jQuery.fn.hide = function () { console.log("hiding elements", arguments.callee.caller.toString()); orig.apply(this, arguments);} |