Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Update items in Bulk through PowerShell
New-UsingBlock (New-Object Sitecore.Data.BulkUpdateContext) {
foreach($item in Get-ChildItem -Path master:\content\MyWebsite\Folder01 -Recurse) {
$item.Editing.BeginEdit()
$item.Roles = "{C731475E-D7BF-4BE1-A323-9C059ED2DE49}|{CC6FEF3F-8C13-4EC7-8E5A-9F0E56769FED}"
$item["__Workflow state"] = "{4785314C-2C4A-4784-955B-D638CB42E994}"
$item.Editing.EndEdit() | Out-Null
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment