Sitecore PowerShell Extensions
Slack
YouTube
Stack Exchange
Donate
Search…
Introduction
Disclaimer
Installation
Training
Community
Interfaces
Working with Items
Modules
Libraries and Scripts
Integration Points
Content Editor
Control Panel
Data Sources
Event Handlers
Functions
ISE Plugins
Page Editor
Pipelines
Reports
Tasks
Toolbox
Web API
Workflows
Packaging
Remoting
Security
Releases
Troubleshooting
Code Snippets
Appendix
Powered By
GitBook
ISE Plugins
Custom ribbon commands for use in the ISE.
You can include custom ribbon commands in the ISE to aid in improving the script authoring experience.
ISE Plugins
Add a custom plugin
For this example, we wish to have a plugin that analyzes the script and reports on any errors.
Create a new script stored under the following structure:
Analyze Script
The path structure needs to follow
[MODULE]/Internal/ISE Plugins/[PLUGIN_NAME]
. Here we have
X-Demo/Internal/ISE Plugins/Analyze Script
.
Use the following sample to fill in the script body.
1
if([string]::IsNullOrWhiteSpace($scriptText)){
2
Show-Alert "Script is empty - nothing to format."
3
exit
4
}
5
​
6
Import-Module -Name PSScriptAnalyzer
7
Invoke-ScriptAnalyzer -ScriptDefinition $scriptText
Copied!
Now you can run the command from the ribbon and see the results in the ISE.
Example results
Previous
Functions
Next
Page Editor
Last modified
2yr ago
Export as PDF
Copy link
Contents
Add a custom plugin