2

I have a requirement that I have a button on the Ribbon like "Generate". If the Content author clicks on this Generate button, through Sitecore Command we are making some API calls, and based on the API response we create some Sitecore items.

Now my requirement is to make this activity automated through Powershell. How could I achieve this?

Thanks in advance.

1

1 Answer 1

1

You will need to find the command that is being executed with the click of the Ribbon item.

Then, you can run the command in Powershell as below:

$commandContext = [Sitecore.Shell.Framework.Commands.CommandContext]::new()
// You will need to mention the full type for the command below
$returnValue = [My.Namespace.Ribbon.Command]::Execute($commandContext)

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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