Questions tagged [powershell-extensions]

Anything related to the Sitecore PowerShell Extensions (SPE) module or general Windows PowerShell.

Filter by
Sorted by
Tagged with
1
vote
1answer
344 views

Mandatory fields with SPE

I'm building a Sitecore powershell script where I'm using Read-Variable to read a few fields. I have added the Mandatory=$true on all of them and it only works for single-line fields but not for ...
4
votes
3answers
609 views

How to Enable Item-level language fallback on all templates in Sitecore 8.x

Presently I'm working on Sitecore 8.1 Update-1. We have enabled Item-level language fallback on shell and website as suggested on Configure language fallback - Sitecore Documentation. It seems after ...
2
votes
1answer
954 views

Displaying Errors from Sitecore PowerShell Using Remoting

Using the remoting capabilities in Sitecore PowerShell Extensions, I'm trying to execute some PowerShell remotely and ensure that any errors that occur display in the local console. How can I do that? ...
1
vote
1answer
354 views

Sitecore PowerShell Extensions switch context language based on site context language

I have a script which loops over different sites in a Sitecore instance. For each site some tasks are done, such as creating and moving items. How can I set the language context for these operations ...
3
votes
1answer
802 views

Turning on Index Viewer for SPE

I have really given it a go before I posted here, but I am trying to turn on the Index Viewer for SPE. The gitbook doco says it exists, shows it not being in the menu, but no info on how to put it in ...
4
votes
3answers
3k views

Sitecore PowerShell Extensions get descendant of an item using a template

I'm writing an SPE script and am looping over my site nodes. For each site node, I want to check if a particular descendant exists and if not then create it. I have the list of top-level nodes, but ...
3
votes
2answers
619 views

How can I migrate all controls on all pages to a certain placeholder?

The layout of our website has been completely overhauled. The old placeholders didn't make sense anymore, so they aren't used in the new layouts. As a result, most content pages are now empty. All ...
1
vote
1answer
671 views

How to connect to a Sitecore instance with Windows PowerShell?

I have reviewed the GitBook and the two blog articles (original and v2) about remoting with SPE, but I've not been successful in executing any commands. Here's an example script I've been trying to ...
4
votes
1answer
471 views

How do you programmatically run a Sitecore agent using Sitecore PowerShell Extensions?

I need to run specific agents on demand. When I try to create a new instance of the agent using PowerShell's New-Object command it doesn't seem to work right.
5
votes
1answer
270 views

Getting “Current Sitecore database cannot be established” using Sitecore Powershell Extensions

I'm trying to get my feet wet in Sitecore Powershell. I need to list renderings on a list of items. Some of the script works, like getting the items and outputting the name, but when calling Get-...
10
votes
2answers
879 views

How to pass arguments to SPE's Invoke-RemoteScript

I want to pass some arguments to a script block that will be run on a remote Sitecore instance via SPE remoting. I wrote this script as a test, but it's not working. $session = New-ScriptSession -...
3
votes
1answer
158 views

Cannot add a User to a Role where the User name contains the “@” sign using PSE

I have to bulk-add a large number of users to a role, to this extent I am using the Add-RoleMember cmdlet. If I run Add-RoleMember -Identity "<role name>" -Members "name.lastname" it works ...
6
votes
2answers
181 views

Sitecore ISE powershell inconsistent results

I am running a script in Sitecore powershell to find items bases on a regular expression on a custom field ('Subkey'). This script sometimes shows results and sometimes shows 'No items available'. ...
7
votes
2answers
509 views

PowerShell Extensions reports: Is it possible to pass / choose parameters?

I have created my first report, now I'd like to make it reusable. Is there any way I could read parameters from "somewhere" after the user clicks the report's name?
6
votes
1answer
616 views

PowerShell ISE: Function of Abort button?

I have noticed that clicking the Abort button in the PowerShell ISE doesn't actually cause the background job to terminate. I guess I shouldn't be surprised since arbitrarily terminating a thread that ...
9
votes
2answers
2k views

Create new language version for content branch

Is there a way in Sitecore Powershell Extensions to create new language versions of a branch in the content tree? I need it to copy exactly the presentation details set on the current language to the ...
6
votes
3answers
1k views

How to reset DisplayName to empty using Sitecore PowerShell Extensions?

I wanted to know better way to reset Display Name to empty using PowerShell scripts. I have written below script.. $item = Get-Item "/sitecore/content/home" $item.Editing.BeginEdit() $item["{...
9
votes
3answers
365 views

Where should I install Powershell module for SXA?

Solution can be installed on many environments - QA, Staging, Prod. In every of these environments Sitecore instances have different roles - CD, CM, Job, Publishing and etc. Should I install ...
11
votes
2answers
561 views

Can you run Sitecore Powershell without triggering Sitecore events?

I want to write a script which could potentially clean up a load of unused assets, but I would like it not to trigger events (index rebuilds etc). Is there a way to say "do this silently" in a ...
11
votes
1answer
671 views

Update all users in the Administrator Role

I want to be able to update all users who have the Administrator checkbox selected without manually going through each of the user. In the same script I would like to add them to another Role. This ...
7
votes
3answers
2k views

How to get list of all the renderings that has been configured to use data source

We are almost complete with a large project. I am trying to find out which rendering in the page has been configured to use data source using a Powershell script. So that we can run in both UAT and ...
6
votes
2answers
292 views

Getting locked items SPE

I have a multisite Sitecore instance and I would like to get all locked items from all different sites and users and unlock them, is it possible to do this job using Sitecore Powershell Extensions?
3
votes
1answer
709 views

How do I parse a Rich Text in PowerShell in order to replace elements?

I have a requirement to read each rich text field and then edit the content with unordered lists rather than ordered.
8
votes
1answer
706 views

Update same rendering of several templates using SPE

I have a bunch of templates which have a Coveo Search Box View rendering associated on the standard values. I need to update the property "Reveal Advanced Query Suggestions" of all of them(a lot of ...
6
votes
1answer
556 views

Unable to get value of $_.Source using SPE

I have a rich text field in my user defined template and I want to replace the source value of the rich text field. Below is my query where I'm able to read Name, type etc, however $_.source is ...
7
votes
2answers
757 views

How to create Sitecore Context Item to copy Item Path using SPE?

How to create Sitecore Context Item to copy Item Path using Sitecore PowerShell Extensions. Like in below screen we have for Layout Copy Renderings and Quick download package. Sometimes it requires ...
40
votes
5answers
2k views

How can I programmatically add a rendering to all of my content items?

I need to add a rendering to all of the pages in my Sitecore tree (i.e., items that have renderings, have a layout set, and live under /sitecore/Content). Content items that don't have renderings or a ...