Created
August 21, 2015 10:15
-
-
Save AlexKasaku/073fab1fd001eadc0fe9 to your computer and use it in GitHub Desktop.
Update a bunch of items to edit a field
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") ) { | |
$newUrl = $item."Requested Url" -replace "/sitecore/admin/sitecore/content/xxx/home","" | |
Write-Host $item."Requested Url" | |
$item."Requested Url" = $newUrl | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment