Questions tagged [powershell-extensions]

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

50 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
1answer
169 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 ...
5
votes
0answers
189 views

CI/CD Sitecore challenge: going from “wipe” to “overwrite”

We are set to release a large Sitecore-based system in a week. Presently the CI/CD process works by effectively republishing everything from a git repository as the source (we use TDS for day-to-day ...
4
votes
0answers
87 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 ...
3
votes
0answers
228 views

Get-ItemReferrer : Object reference not set to an instance of an object

I am working on Sitecore PowerShell Extensions 5.0.0.42513 with Sitecore 9.0. I have started facing issue as Get-ItemReferrer : Object reference not set to an instance of an object Also shown below ...
3
votes
0answers
77 views

Get workflow history for an item by itemid in sitecore powershell extension - Sitecore 8.1

I need to create a report by Sitecore Powershell Extension where I need to include the details of "Workflow Approver" and "Date on which workflow approved". I have got the list of referring items for ...
3
votes
0answers
66 views

Is it possible to install PowerShell Module for Sitecore and SPE Remoting module remotely?

Is it possible to install the PowerShell Module for Sitecore and SPE Remoting module remotely? I'm wondering if it is possible to install it via ansible to a new Sitecore instance and then remotely ...
3
votes
0answers
28 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 ...
3
votes
0answers
91 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 ...
3
votes
0answers
235 views

How to bulk upload media files and set each item's template to custom template?

I have a directory structure that looks like this: -- Folder 1 ---- Folder 2 ------- File 1 ---- Folder 3 ------- File 1 And so on with Folder 1 being the parent folder. When I upload the files from ...
3
votes
1answer
231 views

New item is not in focused after creation using powershell

When we create an item in a Sitecore bucket folder using PowerShell Extensions like shown below: New-Item -Path "$PathofBucketFolder" -Name $TitleofanItem -ItemType $TemplateofanItem The item gets ...
2
votes
0answers
78 views

Unable to get xDB reports using Sitecore Powershell

I am trying to get the Page URL visits which we get from Experience Analytics dashboard using Powershell. Below screenshot specifies the data i am trying to access using Powershell. I found a link ...
2
votes
1answer
181 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 ...
2
votes
0answers
126 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 ...
2
votes
0answers
258 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....
2
votes
0answers
802 views

Show-ListView called from action script display columns from parent Show-ListView

We're using Sitecore PowerShell Extensions to generate some reports. We have a problem when calling "Show-ListView" from the "Actions" script that is in the parent "Show-ListView" result. Looks ...
2
votes
0answers
350 views

Security disabler doesn't operate in context of Unlock-Item comandlet?

Writing a script to allow editors to unlock an item locked by another user I used New-UsingBlock(New-Object -TypeName "Sitecore.SecurityModel.SecurityDisabler"){ $item | Unlock-Item } This didn't ...
2
votes
0answers
925 views

SPE Remove-Rendering with -FinalLayout Removing all renderings from the Final Layout

I recently wrote my first Powershell script for removing an old rendering from a placeholder and replacing it with a new rendering. For some reason, when the rendering I need to remove is in the ...
1
vote
2answers
94 views

Sitecore Powershell Extension throws null-valued expression exception

On a fresh Windows VM I installed powershell extensions module: Install-Module SPE Then I am trying to invoke a remote script on my sitecore instance: $url = "https://my-sitecore.azurewebsites.net" ...
1
vote
0answers
41 views

Pagination on Update-ListView

I have written a PowerShell script as an action to delete selected items in the list view. The issue is - when I delete an item on any page other than the first one, after deletion, update-listview ...
1
vote
0answers
52 views

Session Elevation options when using Federated Authentication

When I want to excecute a powerhsel Script in sitecore 9 update 2 with SPE 5 I get the following authentication Dialog. But I am using Azure Federated Authentication Login to log in into sitecore. ...
1
vote
0answers
351 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
1answer
113 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
202 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 ...
1
vote
0answers
50 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
0answers
189 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
0answers
185 views

PowerShell find-item doesn't return values

I'm currently using find-item on Sitecore PowerShell Find-Item -Index sitecore_master_index -Criteria @{Filter = "Equals"; Field = "recipe id"; Value = "Recipe_Lambada"}, @{Filter = "DescendantOf"; ...
1
vote
0answers
194 views

Use custom Mongo db with Powershell

I have a custom mongo database, that database contains information about pages.I need to query it in order to use SEP to create pages according to that info, ig, adding renderings component, etc. ...
1
vote
0answers
114 views

“PowerShell Script Workflow Action”(approve/reject) is not fired from the workbox page on IE browser

"PowerShell Script Workflow Action"(approve/reject) is not fired from the workbox page on IE browser. Whereas it is working fine on chrome browser. None of the buttons(approve,approval all, reject ...
1
vote
0answers
169 views

Adding placeholder settings to presentation details of many items

I have to add a bunch of placeholder settings to a bunch of items. These items already have specific presentation details, so not using the standard values. I tried to add them to standard values, ...
0
votes
0answers
26 views

Invoke-WebRequest throws Access is denied due to invalid credentials while accessing Sitecore EE URL in Powershell

I am trying to get Sitecore users' StartUrl (configured in Profile tab) in powershell and then supply it to Invoke-WebRequest in powershell to get the response status code for the StartUrl (to know if ...
0
votes
0answers
36 views

Sitecore Powershell script for changing item template in all language versions

i want to change the item template in all language version and retain the data. I have tried this : $rootItem = Get-Item master:"/sitecore/content/home/" $sourceTemplate = Get-Item "{...
0
votes
1answer
43 views

Unable to export query result to a file from Sitecore Powershell scirpt with Out-Download command

I have a simple powershell script which uses Out-Download command to export the query result to .xlsx file. However, it doesn't seem working. The same scenario as well if I used the download button ...
0
votes
0answers
27 views

Sitecore Powershell SPE 5.1 “Could not validate access using the provided credentials” error

I have written the SPE powershell script in my local Sitecore 9.1.1 sandbox environment and trying to execute, it is asking session elevate privilege to enter credentials. Even though I am entering ...
0
votes
0answers
31 views

Moving parent item and create alias

I'm working on cleaning up sitecore items where i have bunch of items sitting under various nodes so what i'm trying to archive is to move all under single folder and create alias on the original path....
0
votes
0answers
25 views

Sitecore PowerShell access allow/deny at same time

Hello Sitecore SPE Experts, I have a very basic question, hope anyone help me: I am using something like below Add-ItemAcl -Path master:\content\home -AccessRight "item:read" -PropagationType Any - ...
0
votes
0answers
39 views

SXA Creative Exchange Import triggered via SPE not working

I was trying to set up a CI/CD according to the documentation, where I planned to trigger a Creative Exchange Import via Sitecore Powershell Extensions Web Api. https://doc.sitecore.com/developers/...
0
votes
0answers
25 views

Can we copy entire master DB from staging to Dev using sitecore Powershell?

I am curious to know any such commands or way to copy master DB from one sitecore environment to another ? I have a clue of using Copy-Item however I don't have much idea on that.
0
votes
0answers
45 views

Powershell script runtime error when clicking navigate/export excel button in showlistview result

I am using Powershell to generate a report using show-listview but sometimes when the user clicks the excel report or navigation button in the result window it's showing a runtime error. I have ...
0
votes
1answer
34 views

SXA Missing Variants in a cloned rendering

i followed the documentation https://doc.sitecore.com/developers/sxa/93/sitecore-experience-accelerator/en/copy-and-customize-a-rendering.html and cloned a Page Content rendering. The script finished, ...
0
votes
0answers
37 views

How to delete specific saved Sitecore Forms entries using SPE

I'm using Sitecore 9.0.1 and using the default Save Data submit action on my form: There are many garbage entries due to test and bot submissions, and there isn't a way to delete any of the entries. ...
0
votes
0answers
33 views

Override SXA Site Scaffolding

I'm aware of how to add additional items to site scaffolding via inserting items into a /sitecore/templates/Foundation/Experience Accelerator/Scaffolding/Roots/SiteSetupRoot template. I'm interested ...
0
votes
0answers
72 views

Scheduled Task running through Sitecore Powershell extensions shows as running even when it completes

We are running a Scheduled Task manually through Sitecore PowerShell Extensions. The task runs for around 2-3 hours and completes successfully. But the Script window still shows as running even though ...
0
votes
0answers
95 views

Migrate some items from one database to another having same or slightly different templates

I need to migrate data from one database say migration DB to master database using powershell scripts. I have the migration database(client's database copy) .bak file of sitecore 8.2 and have ...
0
votes
0answers
128 views

Identity Server + Sitecore Powershell: Non-admin cannot see scripts

I am using Sitecore 9.1 with Identity Server configured to authenticate users against Azure Active Directory. This works great and users can login with their azure accounts without issue. I have ...
0
votes
0answers
46 views

Workflow is not getting assigned for items

I'm creating a template and assigning a workflow to that template. But the items which are created from that template are not having the workflow value. $template = New-Item -Path "/sitecore/...
0
votes
0answers
192 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 ...
0
votes
0answers
158 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 ...
0
votes
0answers
172 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
1answer
38 views

Executing Sitecore PowerShell script programmatically - Sitecore path not resolving

I am calling the powershell script programmatically using Sitecore Command.. ScriptSession.ExecuteScriptPart() ... Inside the script I have written following script: $settingItemId = "/sitecore/...
-1
votes
1answer
31 views

Copy data from en language version to other language version

I need to copy item field data from en language to all other available languagesin all versions. Any powershell script of achieving this.