Skip to content

Instantly share code, notes, and snippets.

Alex Washtell AlexKasaku

Block or report user

Report or block AlexKasaku

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:52fa4e063733feaca2fab567beacfd30
ffmpeg.exe -i "Video.mkv" -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 448k "AC3.mkv"
@AlexKasaku
AlexKasaku / Remove Site Language.ps1
Last active Jan 1, 2019
Remove a language from an SXA site. Based on the "Add Site Language" set of scripts that comes with SXA.
View Remove Site Language.ps1
# Functions Site Language/Remove Site Language
Import-Function Validate-PowerShell
Test-PowerShell
Try
{
$ctx = Get-Item .
View CopyPathToClipboard.ps1
function cwd { $pwd.Path.Trim() | Set-Clipboard }
@AlexKasaku
AlexKasaku / DeleteContentDeliveryFiles.ps1
Created Nov 30, 2016
Delete Content Delivery files
View DeleteContentDeliveryFiles.ps1
#
# Takes a list of configuration files that should be disabled on a Content Delivery server and renames them with a
# .octopus_disabled suffix so they are not loaded.
#
# Prepared for Sitecore 8.1 Update 3
$baseFolder = "YOUR WEBSITE FOLDER"
$files = (
"App_Config\Include\001.Sitecore.Speak.Important.config",
@AlexKasaku
AlexKasaku / ChangeTemplateMaintainingLayout.ps1
Created Nov 10, 2016
Change template without breaking layout
View ChangeTemplateMaintainingLayout.ps1
$item = Get-Item -Path master: -ID "{C7FF7164-CECC-44A5-9A16-784619578316}"
$sharedLayout = $item.__Renderings
$finalLayout = $item."__Final Renderings"
if ([Sitecore.Xml.Patch.XmlPatchUtils]::IsXmlPatch($finalLayout))
{
$finalLayoutFull = [Sitecore.Data.Fields.XmlDeltas]::ApplyDelta($sharedLayout, $finalLayout)
}
@AlexKasaku
AlexKasaku / ExportItemLayouts.ps1
Last active Nov 3, 2016
Export item layouts based on a list of item paths
View ExportItemLayouts.ps1
$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
@AlexKasaku
AlexKasaku / MoveFinalRenderingsToShared.ps1
Last active Nov 2, 2016
Move Final Renderings value to Shared for Standard Values
View MoveFinalRenderingsToShared.ps1
$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
@AlexKasaku
AlexKasaku / ExamineRenderings.ps1
Last active Oct 21, 2016
Examine renderings in Standard Values to find uses of Shared + Final
View ExamineRenderings.ps1
$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
View Find Rendering By Parameter And ID.ps1
$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
@AlexKasaku
AlexKasaku / Find Rendering By Parameter.ps1
Created Sep 12, 2016
Find items that have a Rendering that uses a particular parameter
View Find Rendering By Parameter.ps1
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
}
You can’t perform that action at this time.