The Sitecore Powershell Extension is a module that provides a command-line interface and scripting environment to work with the Sitecore platform. Using the Powershell Extension, we can perform various operations of Sitecore items, as well as allow access to Sitecore APIs. It looks and works in the same way as the Windows Powershell utility.
Sitecore Powershell Extension is not installed out of the box, therefore, we need to install it separately.
Installing the Sitecore Powershell Extension Module
- Go to http://marketplace.sitecore.net/ and download the package for Sitecore Powershell Extension for your Sitecore instance.
- Install the downloaded package in your instance.
- After successful installation, you will see the following additions to your Launchpad and Desktop.
Launchpad
Desktop
Tools that Come With the Sitecore Powershell Extension Module
- Powershell Console
This tool provides a simple command-line interface in the same way as our Windows Powershell. You can enter a single command at a time and see the output.
- Sitecore PowerShell Integrated Scripting Environment (Powershell ISE)
The Sitecore PowerShell ISE is a tool that can be used to create, edit, test, and execute PowerShell scripts. The Sitecore Powershell ISE offers a very advanced and flexible scripting environment.
ISE adds a GUI and more functions. Following are some of the functions that it provides over Powershell Console:
- Saving Powershell scripts and the ability to open them later
- Executing scripts with on click
- Switching the current database
- Switching the current user and language
- Debugging
- Ability to execute selected part of the script
Interface of Powershell ISE
You can see all the options in the menu divided into sections which are named Write, Script Execution, Context, UI Context, and About.
Now, if your Sitecore Powershell Extension package is installed, you can go ahead and open Powershell ISE tool and execute the script to output “Hello World” as shown in the image above.
Useful Links:
This was just a basic introduction to the Sitecore Powershell Extension module and SPE tools that gets installed with the package. In the next post, we are going to see how we can fetch item information using different Sitecore Powershell Commands.