1

Environment details: Sitecore 10 Azure PAAS hosting

I am trying to automate a few things in an already running Sitecore set-up. For that, I wanted to utilize Sitecore Powershell remoting.

I have gone through different blogs and videos. Still, I have a few questions:

  1. Almost all sample scripts start with Import-Module -Name SPE such as here. So, from wherever this script has to be executed, the SPE module should be accessible. So, I can conclude that this script will be present in Sitecore. Is my understanding correct?

  2. But then why do we need to provide the Connection URI, as mentioned here, if the script is being executed on the Sitecore instance?

  3. If the script is being executed outside, how Sitecore is identifying the methods being exposed, as shown in the video

It would be of great help if the community can help me to understand how things work under the hood

1 Answer 1

1

Sitecore PowerShell Remoting (SPE Remoting) is broken up into two parts.

Part 1: Remoting web services installed in the CM/Standalone instance

These services are distributed with the packages provided for SPE but do require patches to enable/configure the services. For example, the "remoting" endpoint is disabled by default.

Part 2: Windows PowerShell module

The module is something that would be installed on a developer workstation, CI/CD server, or container and is the same environment where the script is executed.


So back to your question.

  • Import-Module -Name SPE is contained with a script running outside of Sitecore.
  • The connection URI is the location of your running instance of Sitecore (e.g. https://demo.dev.local).
  • The SPE module includes commands like Invoke-RemoteScript in which you embed the script to be executed inside a Sitecore context.
3
  • Thanks for clarifying. Just one more thing. Windows PowerShell module is the same one which we get on a new PC with Windows? Jul 26 at 13:40
  • Windows PowerShell 5.1 is typically on a new PC. The SPE Remoting module is something you must install. Jul 26 at 13:54
  • Thank Michael for helping. I was getting confused. Jul 26 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.