Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [powershell-extensions]

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

1
vote
2answers
53 views

Sitecore Powershell Extensions not returning field source value

I'm trying to write a simple Powershell script that finds all General Link fields and outputs the value of their Source field. $fields = Get-ChildItem -Path "master://sitecore/templates/user defined" ...
0
votes
0answers
23 views

How to replace an item with another item by ID in Treelist field using Powershell?

I want to replace an item with another item in a Treelist. Basically, the items I want to replace are broken links. Suppose, There are two items A and B. A is used in a Treelist field, so I want to ...
0
votes
0answers
28 views

Error installing Sitecore PowerShell Extensions 5.0 on Sitecore 9.1 instance ['packageinstall:items:ended' event]

I got this error when trying to install SPE 5.0 on my Sitecore 9.1 instance. [![enter image description here][1]][1] I was able to get more details checking the log files: ManagedPoolThread #3 08:...
1
vote
0answers
22 views

Removing publication restrictions - publication targets

Does anyone know or have a PowerShell script which can remove the checkbox in publication restrictions specific to publication targets for Sitecore items? We need to achieve (2) as below since some ...
1
vote
0answers
25 views

Getting when installing SPE 4.7.2/5.0 on Sitecore XP 9

I am trying to install SXA 1.8.0 on Sitecore 9.1 environment (my local pc as testing) but I cannot install Sitecore Powershell Extension 4.7.2/5.0 which is required to be installed before SXA ...
1
vote
0answers
52 views

Can I automate the PowerShell Extension package installation?

Is it possible to automate the installation of the package that everybody is using to automate the other packages installation? My goal would be having a script which I can use to install SPE on a ...
0
votes
1answer
38 views

PowerShell exception at Receive-File dialog

I have a PowerShell code like this Import-Function Validate-PowerShell Test-PowerShell Try { $ctx = get-item . Import-Function Import-RedirectMappings $file = Receive-File (get-item "...
0
votes
2answers
38 views

Powershell script to update displayname error

When I try to update the display name of the item am getting the following error. Please let me know how to fix this? Working Please wait, working... unlike you! 'DisplayName' ...
1
vote
1answer
31 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
25 views

Setting Page Design field in Sitecore pages

I'd like to set the Page Design field in certain pages of a certain template to a value in sitecore using powershell script. I tried the following but it didn't work. I also tried the name of the page ...
0
votes
1answer
44 views

PowerShell script to update field with IDs to media items

Trying to update media item field through script .In the csv file I have item name for uploaded images that needs to be updated in the Imagefield script: $AllPhotoGallery = Get-ChildItem -Path "...
0
votes
1answer
80 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
6
votes
1answer
105 views

Upload Files (Advanced) randomly removing dashes

I'm working on a SPE script that uses the standard media library upload tool to take a file then uses the built in unzipper to unzip it. Upon unzipping the media items sometimes it removes dashes from ...
3
votes
0answers
15 views

Restoring marketing taxonomies with Sitecore powershell extenstion

I am trying to automate Sitecore upgrade from 8.1 to 9.0.1. In Upgrade steps, There is one step restoring deleted marketing taxonomies, which can easily be done with Url navigation and click button on ...
1
vote
1answer
66 views

How do you publish with the Publishing Service using SPE?

The Publish-Item command appears to use the older API for publishing (slow). When I run the script below, I do not see the publishing job appear in the Publishing Service dashboard. $item = Get-Item ...
5
votes
1answer
57 views

Add Placeholder To Presentation Details Using Sitecore Powershell

I'm attempting to use Sitecore Powershell Extensions to automate Step 2 of the following upgrade guide for a Sitecore accelerator known as SCORE: https://brainjocks.atlassian.net/wiki/spaces/SDD/...
2
votes
1answer
34 views

How do I get the raw date value in my SPE report?

While trying to create a report compatible with the SPE Data Importer, I noticed that the date is formatted rather than the raw value. How do I change this script to give me the date in the proper ...
1
vote
0answers
40 views

SPE Object reference not set to an instance of an object

In Sitecore 9.02 I get this error running any script in Powershell ISE. Console works fine. Stack trace: [NullReferenceException: Object reference not set to an instance of an object.] Cognifide....
5
votes
1answer
240 views

How do you change the sort order of items using PowerShell

I have some items created using New-Item but they are automatically sorted alphabetically. I would much prefer these items to be sorted by Created date. How do you change the sort order of items ...
3
votes
1answer
108 views

How to copy multiple items to a new location

Got over 200 items in various folders in one location that would like to copy to a new location while retaining the same folder structure. Each item has more than one version and would like to retain ...
1
vote
1answer
133 views

How can I specify a specific log file to write to from a Sitecore Powershell script?

I have some scripts where I'd like to separate their log output from the standard Sitecore Powershell log (SPE.log). Is there a parameter which I can use on Write-Log to output to a named log file?
1
vote
1answer
81 views

Reading a CSV file from media library through power shell script

This is working fine $global:ProductPath = "/sitecore/content/Home/Content_Pages/ " $csv = Import-CSV "C:\inetpub\wwwroot\mysample\Book1.csv" $bulk = New-Object "Sitecore.Data.BulkUpdateContext" try ...
2
votes
2answers
67 views

Is it possible to edit the InsertItems of an item

I have managed to get a list of items that use a specific template. I now want to add an Insert option to each of those items. I understand that I can edit the template Insert options and update the ...
4
votes
2answers
395 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 ...
0
votes
2answers
55 views

Getting all items using a Specific Sublayout using Sitecore Powershell Extensions

I have to get data of rendering parameters used by a specific sub-layout. Is there a way to get all items which are using a particular Sublayout. Example: I have a Sublayout "SiteHeader" and it has a ...
2
votes
1answer
87 views

How to get detailed installation log while the update package is being installed remotely using SPE?

I'm using SPE to install the TDS .update package file. How do I get detailed installation log remotely in the script below? Current PowerShell Script: $SitecoreInstanceUri = "https://helixsite....
4
votes
3answers
108 views

How to disable Publishing Temporarily?

During certain periods we have the requirement to disable publishing for a period of time. The current approach for this is pretty brute-force. Delete the Publishing Targets and then restore them from ...
0
votes
3answers
149 views

Traverse to parent item that matches the given template id using Sitecore Powershell Extension

I want to find the ancestor of an item that matches the given template id using Powershell. Can anyone help me in achieving this? Scenario: I'm on Item A, I get the current item details using gi .. ...
6
votes
1answer
44 views

How to determine whether an editor is using the Desktop Content Editor or Launchpad Content Editor?

I've been doing a lot more SPE report implementations and noticed that the functionality of loading the ListView is dependent on whether the editor is using the Content Editor from Launchpad or the ...
3
votes
1answer
52 views

Determining whether item has been published

Is there an easy way using SPE to determine whether an item has been published?
3
votes
1answer
52 views

Using Show-ListView to Display a Dynamic Number of Columns in Sitecore Powershell

My goal is to use the Show-ListView function available in Sitecore Powershell to show a dynamic number of columns. I'm currently executing the Show-ListView function as follows: $table | Show-...
2
votes
1answer
41 views

Setting Presentation Aliases with Sitecore Powershell Extensions

In Sitecore 9, in the Content Editor and under the Presentation tab, there's an option to set Aliases on an item. Assuming you already have the desired item stored in variable $item, how would you set ...
1
vote
0answers
29 views

PowerShell Receive-File dialog is empty

I'm trying this really easy Receive-File but I'm getting a blanc popup. I've tried different paths but always get the same result. Another popup Read-Host is no problem. That one shows correctly. I'...
1
vote
2answers
81 views

Force saving of an item

I have several newly added save events for existing items. Any way to force a save of an item? When I do $item.Editing.BeginEdit() / $item.Editing.EndEdit() in PowerShell it returns false since ...
5
votes
2answers
139 views

Getting and setting the order of renderings/sublayouts on a page

I have written a PowerShell script that replaces sublayouts with renderings across all pages in a Sitecore site. Everything is working well except for the order of the renderings. The order always ...
0
votes
1answer
228 views

Sitecore PowerShell RemoveLinks() using Broken Links Report

I am currently using the Sitecore Powershell Broken Links Report to find and delete broken links. Using the Broken Links Report, I have been able to locate the broken links. I can't seem to delete ...
2
votes
1answer
198 views

SPE to Unlock all items locked by a specific user

Is there a quick way to unlock all the items locked by a specific user from an admin account?
1
vote
1answer
87 views

Negate the criteria filter in Sitecore Powershell Find-Item call?

I'm trying to find all items in Sitecore where a particular field ("ShortTitle") is blank. I have the following call working to Sitecore Powershell Extensions's (SPE) Find-Item, but there doesn't seem ...
5
votes
1answer
89 views

Broken Links Report Options Powershell vs. Fast Query?

I am currently trying to find and delete broken links in the Sitecore master database. I am using a version of this script. The problem I am having is that the number of items in the content tree is ...
3
votes
0answers
54 views

ShowFieldEditor on a media item detaching media

I have a simple script that we're running, where a content editor has bulk uploaded media and they want to go back through and provide attribution to the images (caption, alt text, photo credit) and ...
0
votes
1answer
47 views

New-ItemClone Error through SPE

I recently tried using New-ItemClone command on SPE and encountered this error: System.AggregateException,Cognifide.PowerShell.Commandlets.Data.Clones.NewItemCloneCommand These are the codes used: ...
7
votes
1answer
137 views

SPE How to add multiple items to package source

I'm writing a SPE script to package up all unused media library items under a specific folder (prior to deletion). I've found New-Package and New-ItemSource methods and know how to use them (to some ...
0
votes
0answers
24 views

Getting Document moved error while running remote powershell script in Sitecore 9.0 update 1 PAAS

I am trying to run Sitecore powershell script remotely using below script Import-Module -Name SPE $session = New-ScriptSession -Username $userName -Password $password -ConnectionUri $uri Invoke-...
1
vote
0answers
137 views

Sitecore Commerce 9 Update 1 Installation Issue with SPE 4.7.2

I tried to install Sitecore Commerce using PowerShell script but I got the error that resource is not found for Sitecore PowerShell Extensions 4.7.2 although I have this zip package for Sitecore 9 ...
1
vote
1answer
60 views

Type or namespace 'ProxyManager' does not exist in the namespace 'Sitecore.Data.Proxies'

I've recently downloaded the source codes for Sitecore Powershell Extensions from GitHub and I've updated the Sitecore references to use the Sitecore 9 Nuget references. After doing so, I've found ...
0
votes
2answers
56 views

Improving queries performance

I have a script that goes and queries a string from a field box. Issue: This script takes too long! How can I improve the time to get results? Set-Location master: Get-ChildItem -Path "master:\\...
2
votes
3answers
1k views

Sitecore Powershell Script to find all the items with Personalizations defined

I need to find all the items that has personalization defined on the layout definitions using a Sitecore Powershell Extensions script.
2
votes
2answers
77 views

Set accessor for property “Proxy” unavailable - Sitecore PowerShell Extensions

I have been recently started working with Sitecore and Sitecore PowerShell Extensions, but have been struggling for a while. On my local clean instance of Sitecore, I have installed the SPE package ...
8
votes
1answer
188 views

Upgrade path from Integrated Dynamic Placeholders to Sitecore 9 Dynamic Placeholders (OOTB)

Does anyone have a SPE script that could be used to upgrade the rendering parameters of existing content to the new dynamic placeholder style required for Sitecore 9 Dynamic placeholders? We used to ...
0
votes
1answer
238 views

Sitecore Powershell Script to find publish history for a particular date

Is it possible find all the items published on a given date along with Published user , published Date and time using sitecore powershell ?