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
$defaultDevice = Get-LayoutDevice "Default" | |
$paths = @( | |
"/sitecore/content/home", | |
) | |
$paths | Get-Item -Path master:$path | Select ID, FullPath, @{Name="Final Layout";Expression={$_."__Final Renderings"}} | Show-ListView |
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
$results = @(); | |
foreach ( $item in Get-ChildItem -Recurse ) | |
{ | |
if ($item.Name -ne "__Standard Values") { | |
continue; | |
} | |
$result = New-Object System.Object | |
$result | Add-Member -type NoteProperty -name ID -value $item.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
$rendering = Get-Item -Path master:/sitecore/layout/Renderings/Website/Components/Path | |
foreach ( $item in Get-ChildItem -Path master:/sitecore/content/Home -WithParent ) | |
{ | |
$params = @{ "param" = "*" } | |
$renderings = Get-Rendering -Item $item -Rendering $rendering -FinalLayout -Parameter $params | |
if ($renderings.Count -gt 0) | |
{ | |
# This item has a rendering with the parameter |
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 ( $item in Get-ChildItem -Path master:/sitecore/content/Home -WithParent -Recurse ) | |
{ | |
$params = @{ "paramName" = "*" } | |
$renderings = Get-Rendering -Item $item -Parameter $params | |
if ($renderings.Count -gt 0) | |
{ | |
# This item has a rendering with the parameter | |
$item.FullPath | |
} |
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
# Convert items' Final Layout to an XML Delta version. | |
$defaultDevice = Get-LayoutDevice "Default" | |
foreach ( $item in Get-ChildItem -Recurse ) | |
{ | |
# Confirm item has a layout | |
try { | |
# Get-Layout can throw an error if layout is badly formed, so we catch it and continue if this happens. | |
if ((Get-Layout -Item $item -Device $defaultDevice) -eq $null) { |
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
$session = New-ScriptSession -Username admin -Password b -ConnectionUri http://sc81rev151003 | |
Invoke-RemoteScript -Session $session -ScriptBlock { | |
Get-ChildItem -Path "master:/sitecore/media library/Test" -Recurse | ?{ $_.Size -gt 0 } | Select -Expand ItemPath | |
} | Receive-RemoteItem -Session $session -Destination "C:\temp\Images\Downloaded\" -Database master |
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
$session = New-ScriptSession -Username admin -Password b -ConnectionUri http://sc81rev151003/ | |
$baseFolder = "C:\Temp\Images\ToUpload\" | |
$baseItemPath = "master:/sitecore/media library/Test/" | |
# Get folder structure, renaming to suit the Sitecore path | |
$foldersToCreate = Get-ChildItem -Path $baseFolder -Recurse | ?{ $_.PSIsContainer } | % { $_.FullName -replace [regex]::escape($baseFolder), $baseItemPath -replace "\\", "/" } | |
$args = @{ | |
"paths" = $foldersToCreate |
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:\Sites\bma8" | |
Set-Location $source | |
$ignoreFolder = @() | |
$ignoreFolder += "\Website\App_Data" | |
$ignoreFolder += "\Website\temp" | |
$ignoreFolder += "\Data\debug" | |
$ignoreFolder += "\Data\diagnostics" | |
$ignoreFolder += "\Data\indexes" | |
$ignoreFolder += "\Data\logs" |
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 Where-TemplateDerives { | |
param( | |
[Parameter(Mandatory=$true,ValueFromPipeline=$true)] | |
[Sitecore.Data.Items.Item]$Item, | |
[Parameter(Mandatory=$true,Position=0)] | |
[string]$TemplateID | |
) | |
process { |