Questions tagged [powershell-extensions]

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

Filter by
Sorted by
Tagged with
13
votes
3answers
2k views

Sitecore Powershell query for big images of a certain size

Can someone help me with the Sitecore Powershell query which I can use for finding the images more than the given size.
4
votes
3answers
252 views

Sitecore PowerShell extensions module compatibility with Sitecore 9.2

I am trying to install the Sitecore PowerShell extensions module in Sitecore 9.2. While installing this module, I received a w3wp crash error as: When I try to run any script, I am receiving "...
39
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 ...
6
votes
2answers
2k views

Powershell get all items that use a template

The title pretty much says it all - I've looked at the docs but I just keep finding Get-Item and Get-ItemTempate. Lets say I have a template with id 123456, I want to get all items that are using ...
3
votes
2answers
676 views

Unlocking items via Sitecore PowerShell Extensions scheduled task

I'm using Sitecore Powershell Extensions to unlock items that have been locked for an extended period of time. The script is stored in the script library: $item = Get-Item -Path master:\content\ $...
3
votes
1answer
788 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 ...
11
votes
4answers
2k views

Copy final layout to shared layout

Our content authors, makes a lot of mistake when whey work in Experience Editor. Quite often they do some changes on final layout, but expect to have it on shared layout. Is is any tool exist that ...
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 ...
11
votes
2answers
542 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 ...
4
votes
2answers
807 views

Create Sitecore Link with Powershell

I'm working on some reports using Sitecore Powershell Extensions. One requirement is to provide the public URL for various Sitecore items. I'm thinking this isn't really possible via Link Manager ...
7
votes
2answers
8k views

How to check an item exists with powershell without raising an error?

In Sitecore Powershell extensions I can use If ( Get-Item ...) to return true if an item exists or false if it doesn't, but if the item isn't found then it outputs an error message as well. Is ...
6
votes
1answer
444 views

How to escape a query in Sitecore PowerShell

This PowerShell query breaks, if the item name contains query operators such as "and" or "child". How should I escape it, so that they don't break it? $SourceItemPath = $SourceItem.Paths.path $...
5
votes
1answer
81 views

Run powershell script when new user is created

So, I've been successful in creating a powershell script that modifies the MyToolbar to what we need based on the user's domain: $ribbonCommands = "{1DDBC2B7-69B4-44A0-AAF9-895AB51B1F00}|{D87FDF3B-...
5
votes
1answer
377 views

What is the call depth limit in Sitecore PowerShell and can it be overridden?

I have a recursive script that hits a System.Management.Automation.ScriptCallDepthException exception. What is the call depth limit in Sitecore PowerShell and can it be overridden? Note: Yes, I can ...
3
votes
1answer
419 views

Item.Editing.EndEdit() is not triggering save event when called from Powershell extension

We have written one rule for bucket items and it gets triggered when an bucket item is created or item is saved. for creating an bucket item we use below code $updatedItem=New-Item -Path "$parentPath"...
2
votes
1answer
335 views

Export of of script results to Excel not working

When I get a ListView with script results, and want to export the results to Excel etc., nothing happens when I click on the buttons. I do however get an error in the developer tools console: ...
2
votes
3answers
1k views

Running PowerShell scripts without using Sitecore PowerShell Extensions module

We are facing some issues with Lucene during installation of PowerShell Extensions module (SPE). Is there any option to run Sitecore scripts from Windows PowerShell? I mean that I will just add ...
1
vote
1answer
289 views

One time delete of old versions

Master database has more than 500 items that have more than 10 item versions. Some content items have more than 100 versions. According to recommendation to limit 10 item versions I want to perform a ...
0
votes
1answer
422 views

Sitecore Powershell script to find items that break inheritance

I need to write a Powershell script to find items that refer to a specific composite component and break inheritance for presentation. If I go to the Navigation Tab in the Content Editor and click ...
0
votes
1answer
368 views

PowerShell script to compare latest version number of master and web DB in sitecore

Can Anyone help writing a PS script to get the item list where the latest version on web db is different than master