PowerShell is a commonly used console language by which you can perform any operation above the Windows operation system. Sitecore has implemented this language very successfully in the form of the Sitecore Powershell Extensions (SPE) module. By using this module, you can automate a number of operations and therefore fully use the possibilities of Sitecore.
The SPE module is not part of the standard Sitecore installation. Therefore, it is necessary to subsequently install this module. It is possible to download the necessary package from the Sitecore MarketPlace.
Download the newest version of the SPE full release package based on the Sitecore version you are using and install it via Control Panel -> Install a package.
By installing the SPE module, you will gain access to several tools, which are available via the standard Sitecore interfaces.
Can be run via Desktop -> PowerShell Console, see Figure.
We can use the PowerShell console similarly to the command-line in Windows, where individual commands can be entered. The tool is rather more suitable for an advanced programmer.
Can either directly be run from the Sitecore launch pad or via Desktop -> Development Tools -> PowerShell ISE, see Figures.
PowerShell ISE is some type of extension above the console. It provides a number of functions, which allows the programmer to create a functional PowerShell script.
To illustrate, I will present the most basic functions:
- Opening and saving written scripts
- Running scripts
- Debug scripts similarly as in Visual Studio or other development tools
- Inserting breakpoints
- Switching the current database and the user
You can see the PowerShell ISE interfaces along with a demonstration of the announcement of the “/sitecore“ item descendents on the following figure.
Accessible via Desktop -> PowerShell Toolbox. Here, you will find several tools, which you will use during Sitecore maintenance. This for example deals with o Task Manager, Session Manager, etc. See Figure.
By using Sitecore PowerShell you will shift in your Sitecore use and administration possibilities.
In the next part of this article, we will look more closely at the possibility of running PowerShell scripts from an external console without the need to be signed in to Sitecore interfaces.