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 | |
Runs a clean up for each database. | |
.NOTES | |
Michael West | |
#> | |
foreach($database in Get-Database) { | |
if(!$database.ReadOnly) { | |
Write-Log "Cleaning up the $($database) database." | |
$time = Measure-Command { | |
$database.CleanupDatabase() | |
} | |
Write-Log "Completed cleaning up the $($database) database in $($time.TotalSeconds) seconds." | |
} | |
} |
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 | |
Runs a clean up for each link database. | |
.NOTES | |
Michael West | |
#> | |
foreach($database in Get-Database) { | |
if(!$database.ReadOnly) { | |
Write-Log "Rebuilding the $($database) link database." | |
$time = Measure-Command { | |
[Sitecore.Globals]::LinkDatabase.Rebuild($database) | |
} | |
Write-Log "Completed rebuilding the $($database) link database in $($time.TotalSeconds) seconds." | |
} | |
} |
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 | |
Rebuilds all the content search indexes. | |
.NOTES | |
Michael West | |
#> | |
foreach($index in [Sitecore.ContentSearch.ContentSearchManager]::Indexes) { | |
Write-Log "Rebuilding the $($index.Name) search index." | |
$time = Measure-Command { | |
$index.Rebuild() | |
} | |
Write-Log "Completed rebuilding the $($index.Name) search index in $($time.TotalSeconds) seconds." | |
} |
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 | |
Rebuilds the search indexes. | |
.NOTES | |
Michael West | |
#> | |
foreach($index in [Sitecore.Search.SearchManager]::Indexes) { | |
Write-Log "Rebuilding the search index $($index.Name)" | |
$time = Measure-Command { | |
$index.Rebuild() | |
} | |
Write-Log "Completed rebuilding the search index $($index.Name) in $($time.TotalSeconds) seconds." | |
} |
// michael
No comments:
Post a Comment