Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaadansari/64e744e3acc0fa38601f4e750d3b8cf5 to your computer and use it in GitHub Desktop.
Save isaadansari/64e744e3acc0fa38601f4e750d3b8cf5 to your computer and use it in GitHub Desktop.
Update modules to use the new Sitecore PowerShell Extensions 5.0 icons.
<#
.SYNOPSIS
Sitecore PowerShell Extensions 5.0 uses new icons. This script is designed to update
your existing modules to use the new icon.
.DESCRIPTION
The SPE module changes the icon when you enable/disable the module. Only disabled modules
will automatically take the new icon. This is script helps by updating all of the icons
for enabled modules. Alternatively, you can go through and disable then enable the modules.
#>
$scriptRootId = "{A3572733-5062-43E9-A447-54698BC1C637}"
$moduleTemplateId = "{6D82FCD8-C379-443C-97A9-C6423C71E7D5}"
$oldEnabledIcon = "Software/32x32/jar_bean.png"
$newEnabledIcon = "Office/32x32/jar_coffee_bean.png"
Get-ChildItem -Path "master:" -ID $scriptRootId -Recurse |
Where-Object { $_.TemplateID -eq $moduleTemplateId } |
Where-Object { $_.PSFields.Enabled -and $_."__Icon" -eq $oldEnabledIcon } |
ForEach-Object { $_."__Icon" = $newEnabledIcon }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment