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
$courses = gci -r | where-object { $_.TemplateName -ne $null -and $_.TemplateName -eq 'CoursePage' } | |
ForEach ($course in $courses) { | |
$subjectAreaField = $course.SubjectArea | |
if ($subjectAreaField) | |
{ | |
$subjectAreaIDs = $subjectAreaField -split '\|' | |
$subjectArray = @() |
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
gci | % { $_.__Renderings = ($_.__Renderings -replace “{2E07CF1D-DE5B-4D5C-B226-024C549A652E}”,”{FC7EE80B-B784-4E70-9C7B-BCDCE631B67D}”) } |
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
gci -r | where { $_.Name -eq "Apply2015" } | % { $_.Year = "{80B694E2-7FA4-449C-A1DF-07C3E44815CD}" } |
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 | |
Serialize items AND related media items. | |
.NOTES | |
Alex Washtell | |
#> | |
filter Is-InMediaLibrary { | |
if($_.FullPath.StartsWith("/sitecore/media library")) { |
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
$master = [Sitecore.Configuration.Factory]::GetDatabase("master"); | |
$entryTemplate = $master.Templates["User Defined/xxx/Folders/Components Folder"]; | |
Get-ChildItem -recurse | where Name -eq "Components" | % { $_.ChangeTemplate($entryTemplate) } |
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 | |
Removes all media items that are not linked to other items. | |
#> | |
# HasReference determines if the specified item is referenced by any other item. | |
function HasReference { | |
param( | |
$Item | |
) |
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 | |
Removes all Redirect URLs that do not have a valid destination | |
.NOTES | |
Alex Washtell | |
#> | |
# HasReference determines if the specified item is referenced by any other item. | |
filter NoValidDestination { |
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 | |
Removes empty folders | |
#> | |
filter NoChildren { | |
if ($_.Children.Count -eq 0) { | |
$_ | |
} |
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 | |
Updates a field in a set of items | |
#> | |
$items = Get-ChildItem -Recurse | Where TemplateName -eq "Redirect Url" | |
foreach( $item in $items ) { | |
if ($item."Requested Url".StartsWith("/sitecore") ) { |
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 { |
OlderNewer