Questions tagged [powershell-extensions]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
83 views

Attempting to Export Creative Exchange through script web api

I'm attempting to follow the documentation for SXA in a CI/CD process. Configuration Details: Sitecore 9.1 (Standalone Config - My Local Dev) SXA 1.8 initial release PowerShell 5 Running on Windows ...
1
vote
1answer
54 views

How to remove duplicate dynamic placeholders from Final Layout using SPE?

We got duplicate dynamic placeholders assigned in Final Layout. How can I remove the duplicates from the Final Layouts in all the languages? This is how we are filtering out the placeholders ...
1
vote
2answers
58 views

Display save actions for a WFFM form in Sitecore PowerShell

I would like with Sitecore Powershell to extract and display the ID(s) of the save action(s) that a WFFM has assigned. Those IDs in fact the ID of items from /sitecore/system/Modules/Web Forms for ...
0
votes
0answers
58 views

Problems with spaces in SPE Sitecore queries

I am using Sitecore 9.0 and SXA 1.8 and scaffolded a new tenant and site named New Tenant and New Site. When executing the following query using SPE I get not results: Get-Item -Path master:// -Query ...
1
vote
1answer
126 views

Export buttons in Show-ListView is not working

I know there is a similar question before but it has different error than mine. In my ListView result, when I try to click any of the export buttons, nothing happens. Upon checking the SPE logs, this ...
1
vote
1answer
52 views

Not getting any details when running “Install-Update Package” through Sitecore Powershell Module remoting service for my sitecore instance

I am running a Powershell Script using Sitecore Powershell Module remoting service to install .update packages from my host to a remote Sitecore instance but I am not getting any details back on the ...
6
votes
1answer
106 views

Good workflow for SXA powershell scripts

I am trying to find a good way to work with PowerShell scripts that we use for SXA such as for scaffolding. I have tried the PowerShell ISE client that was build into Sitecore but sometimes the UI ...
1
vote
1answer
103 views

How can I copy personalization rules to a rendering in Sitecore Powershell?

I'm copying a rendering from one item to another using Sitecore Powershell Extensions. All is working well, except that the personalization rules for the rendering aren't copied over. I can get/set ...
1
vote
1answer
79 views

How to get Sitecore user create date with PowerShell

I'm building a report with PowerShell, but I can't find where is the creation date for the users. I need filtering by dates range and later get custom properties. Get-User -Filter 'default\*' ` ...
1
vote
1answer
37 views

Get-Package is missing Path parameter [closed]

Weirdly, in one of my script I am trying to do such a call: Get-Package -Path "c:\inetpub\wwwroot\Platform.dev.local\App_Data\packages\This.File.Was.JustCreated.xml" but what I get in return is: ...
2
votes
0answers
39 views

How to add experience editor button with Sitecore Powershell?

I've created a script to aid editors publishing components on a page, and I've added it to the content editor item context menu, but I can't work out how to add a button to do the same from the ...
1
vote
2answers
470 views

How to get ALL specific child-items in a folder using fast query?

I have here a sample content. Now I want to get all the Article Template under the Folder. Sitecore Content Folder Article1 Article2 NewsFolder1 ...
2
votes
0answers
94 views

How to create a Sitecore Module WDP packge **WITH** Sitecore items?

I was following the official documentation on the subject here https://doc.sitecore.com/developers/sat/20/sitecore-azure-toolkit/en/web-deploy-packages-for-a-module.html and realized that it looks ...
4
votes
1answer
226 views

Unable to elevate Console in 9.1 Azure PaaS

I have a relatively clean install of Sitecore PowerShell Extensions v 5.0 in my environment, which is running Sitecore 9.1 on Azure PaaS. As far as I can tell, everything in the install seems to be ...
1
vote
1answer
38 views

How to get the descendants of the values/folder in `Read-Variable` command using `Fast` query?

I have here a Read-Variable command that will make you select any content folder. $root= Get-Item master:\content\home $selectFolder= Read-Variable -Parameters @{ Name = "root"; Title="Start ...
-1
votes
1answer
38 views

How to check an array of items if it has a page layout and output only the page item and exclude its subitems using Powershell? [closed]

I have an array of items stored in $mylist. I'm trying to check items with layout and output them. Here's the script that I have tried: for ($i = 0; $i -le $mylist.count; $i++) { $i = $...
2
votes
1answer
124 views

How can I get the renderings when using the Find-Item command?

I used Find-Item to get the items on my sitecore_master_index. Now, I want to get the presentation details of each item. How can I do get each rendering/presentation details?
2
votes
1answer
39 views

How can I filter or show only one of the duplicates in the results when using Find-Item command?

I used Find-Item to get the items on my sitecore_master_index. However, the results contains same ID but with different languages. I have found out that this item has many language versions in the ...
0
votes
1answer
239 views

How to get items from both master and web Context in PowerShell Extensions without using Get-Item?

I want to get all the items from both master and web database using Find-Item cmdlet and run in one Powershell script. I'd also rather not use Get-Item cmdlet for performance reasons. Any inputs will ...
1
vote
1answer
206 views

Adding new version for each item

I was trying to add new version for each item in sitecore: $root = "master:\content\home" @(Get-Item -Path $root) + @(Get-ChildItem -Path $root) -Recurse | Add-ItemLanguage -Language "en-us" -...
0
votes
1answer
201 views

How to delete Sitecore items without reference using PowerShell script?

We have multi-site application, want to delete items which are not referencing anywhere in content tree. Following are categories: 1) DataSource items 2) Template 3) Media items 4) Renderings How ...
2
votes
1answer
147 views

Inherit child template to the parent template using Powershell

I have 2 templates: Template A: PersonalTemplate Template B: PrivateTemplate Here I want to inherit Template B in Template A using the PowerShell script.
0
votes
1answer
101 views

How to save a file with a custom name using Show-ListView function?

I want to save a file with a custom name while using Show-ListView function. Right now, when I am trying to save the file it is returning in this format "report-2019-02-25_095656.csv". This is the ...
1
vote
1answer
117 views

Sitecore Powershell Extension installation fails

I have to environments test and prod with the same codebase and content installed, and I have installed SPE on the Test system all fine and dandy, but when I try to do it on our production environment ...
2
votes
1answer
113 views

SPE's Download for media files not working - can't find zip file

We have a problem where the Download script used as a right-click menu option is throwing an error. Looking into the script, the problem appears to be how the value [Sitecore.Configuration.Settings]::...
1
vote
2answers
512 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
91 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 ...
1
vote
0answers
218 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
42 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
1answer
153 views

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
136 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
69 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
119 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
354 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
35 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 ...
-1
votes
1answer
311 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 "...
-1
votes
2answers
458 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
131 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
25 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 ...
2
votes
1answer
474 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
155 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
195 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
153 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
637 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 ...
4
votes
2answers
705 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 ...
3
votes
2answers
413 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
330 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
140 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 ...
6
votes
2answers
3k 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
403 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 ...