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
14 views

Adding Active Directory users using SPE and Show-ListView

We have implemented SSO with Sitecore. However, we don't want to allow all users to be able to log in to Sitecore, so the users are created in the extranet domain manually. I'm trying to make the ...
1
vote
1answer
34 views

Sitecore Powershell Task is scheduled to run every minute but it's running every other 10 minutes

I scheduled a Sitecore PowerShell Task to run a Powershell script every minute but for some reason, it's running the task every other 10 minutes. The frequency in the config file is set to 5 seconds. ...
0
votes
2answers
32 views

Azure AD users unable to execute Sitecore PowerShell scripts

We are having issues with the execution of PowerShell scripts that have security permissions based on roles applied to them, when they are executed from within a context menu within Content Editor. ...
1
vote
1answer
66 views

Sitecore Powershell script to filter the users based on custom roles

we have custom roles in sitecore role manager and assigned them to sitecore users. I am writing a Sitecore PowerShell script to filter the users based on my custom role 'Buyer'. below is my script. i ...
1
vote
0answers
30 views

Error while install a Sitecore content package using SPE in Sitecore XP 9.3

On day to day basis we need to install some content packages from one environment to another. For that we are using SPE module and the below script to install the package zip. But it usually fails due ...
1
vote
1answer
27 views

SXA clone site script not cloning media or themes

I have a tenant with a site. When I clone the existing site, the script does not clone the media library or themes. Instead the new site points back to the original sites media and theme locations. (...
0
votes
1answer
25 views

Find-item Greaterthan not recognized by SPE 3.0

I'm working on a PSE script that will work on different sitecore environment with different sitecore versions. This script basically get the list of items that is recently updated between to given ...
3
votes
1answer
61 views

How to exclude an item based on template when using find-item in Powershell

I'm working on this script: $criteria = @( @{Filter = "NotEquals"; Field = "_template"; Value = "{A87A00B1-E6DB-45AB-8B54-636FEC3B5523}"} ) $props = @{ Index = &...
0
votes
2answers
62 views

Creating a new item with “/” in Itemname

I am trying to create a new item in Sitecore from Powershell and using the below command in ISE New-Item -Path "master:\content\home" -Name "A/B Demo" -ItemType "Sample/...
1
vote
0answers
22 views

Unicorn serialized files whose items are edited through SPE are not listed in source control pending changes

We are running Sitecore powershell script to update a item's field. Respective yaml files are generated in web root folder. But not showing in TFS pending changes. On the other hand, if we are ...
0
votes
0answers
31 views

Sitecore Powershell Extensions - Remote Update Package installation not working after recycling app pool

I'm trying to run an update package installation remotely by using the Remoting PowerShell module for SPE. It doesn't install it unless I run it on the SPE console first, and then, remote ...
2
votes
1answer
80 views

Run Powershell script when an Item is being published

I'm trying to do implement some logic while a particular template item is getting published. To implement this logic I started exploring the Sitecore Powershell's Event Handlers. For the events like ...
3
votes
1answer
67 views

Download Image from External URL to Sitecore Media library

Is there a way to add (Download) an image from an external URL to the Sitecore media library directly using SPE? Example: I want to add an image from URL (http://mySite/wp-Rad.jpg) to Sitecore media ...
1
vote
1answer
39 views

Update Commerce Data Templates with SPE

How can I trigger Update Commerce Data Templates from SPE? I am automating a Docker deployment script and the one step that I am missing for it to be fully automated is being able to do this from ...
0
votes
1answer
57 views

How to create button at EE and run powershell script

I need to add a custom button for EE and run a script if the user clicks on the button. basically, I know how to create a button at the core database at /sitecore/content/Applications/WebEdit/Ribbons/...
-2
votes
1answer
127 views

Sitecore PowerShell script to get all images where the media attached is empty

I'm writing a Sitecore PowerShell script to get all images (without their Media Folders) under the path master:\sitecore\media library, where the Media attached is empty. I am using the below code but ...
-2
votes
1answer
43 views

uncheck checkbox and publish in Sitecore

How can we uncheck a checkbox like "upload to cloud cdn" for Sitecore media library and republish it in Sitecore using powershell? Can anyone please help.
0
votes
1answer
57 views

Get the count and size of the subfolders of media folders and media items for each of the medial folders inside media library

I need to get the count of all the media items and folders inside any media folder in media library. Then export the data to csv I am planning to write a script using SPE. Please help me on the same ...
0
votes
1answer
49 views

Adding powershell script to Poststeps folder in App_Data - Is it possible?

I need to do some post step stuff when Sitecore has been installed/set up (And no post step when solution has been built). And it seems that the poststeps folder in App_Data seems to be the way to go. ...
2
votes
1answer
47 views

Import CSV command not working on Azure CM Server

I am using below Powershell command to read CSV file from directory: $importData = Import-CSV "C:\Projects\news_sample.csv" It's working fine on my local Sitecore instance and machine. I am ...
0
votes
1answer
21 views

“Unexpected token :” when getting JSON elements

So I'm able to connect to an API and generate items based on a template from that data. But what is stumping me is the ability to get a child JSON element of one that contains a colon. For example the ...
0
votes
0answers
36 views

Stack empty error when using Sitecore PowerShell Extensions dialog box

I am getting stack empty error while using Sitecore PowerShell Extensions dialog box Error occurs when using Sitecore PowerShell Extensions dialog box (e.g. “Create a new SXA site”) and publishing is ...
0
votes
0answers
19 views

Powershell -ErrorAction not working for Receive-File

I have created the utility to upload a files using Receive-File. Its working fine however if user missed to choose the file and clicked "OK" button in that case I am getting the error ...
1
vote
1answer
51 views

Powershell - Add-ItemVersion

I want to create a new language version via Powershell (the item has no versions yet) but I'm not able to do so via Powershell... I'm not getting an error but the version is also NOT created This is ...
0
votes
1answer
34 views

In Powershell how to enable/show options like Select All | DeSelect All for Multilist field type

Good day!! anyone know how to show the option like Select all and Deselect All for Multilist field type in powershell. Similar kind of functionality available for checklist field type but not ...
0
votes
0answers
68 views

Sitecore powershell, Excel export does not contain all the records after decoding the rich text field

I wrote a script to capture all content from specific location of the content tree, as part of this script I need to take out only the text from the rich text fields. I use the HtmlAgilityPack to ...
-1
votes
1answer
81 views

write sitecore powershell inside C# code

I'm working with Sitecore 9.2 , And I need to create a custom button inside custom ribbon when click on button open dialog so the content author can select date and then i will do my business function ...
0
votes
0answers
27 views

inserting tenant error sitecore 9.2 SXA 1.9

When I try inserting a tenant this error appears I tried reinstalling SXA but no difference happens CodeBeside class "Cognifide.PowerShell.SitecoreIntegrations.Applications.PowerShellRunner,...
0
votes
1answer
24 views

Show path instead of ID in link field result in SPE

I've modified one of the SPE 6.1.1 reports in 9.2 to add a column for a general link field, as our client wants to see which items have links and how old they are (based on the link location). But the ...
0
votes
1answer
51 views

Change field from General Link to Single line text and retain Text

I'm having a similar issue with the one described here: How to change item templates and retain existing data Template_Old Title General Link Template_New Title Single-line text My ...
3
votes
1answer
89 views

Getting the datasource of all components inside the page using SPE

I'm creating a script that would list down all the components in the a particular page then displays the RenderingItemName, RenderingItemID, RenderingItemPath, RenderingDatasource, etc., I found the ...
0
votes
0answers
183 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
1answer
193 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/...
0
votes
1answer
44 views

Sitecore Powershell script for moving bunch of fields to template section

We are trying to refactor few of the Sitecore templates. We need some help with powershell script. Is there any way to pull bunch of fields (around 70-80) to different template sections. Manual pull ...
-1
votes
1answer
68 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 "{...
-1
votes
1answer
179 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.
0
votes
1answer
169 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 ...
1
vote
1answer
441 views

Powershell script for fetching checklist field value

I would like to get checklist field value display name instead of raw values and would like to update its value based on display name. For example I have checklist field values : Test 1 Test 2 Based ...
2
votes
1answer
64 views

How do I query GraphQL using SPE?

How do I leverage SPE to query Solr via GraphQL?
0
votes
0answers
20 views

reorder or rearrange rendering using sitecore powershell [duplicate]

I want to change the position of renderings in the final layout using Sitecore PowerShell existing order headScript AccountDetails Confirmation CardValidation required order of renderings ...
1
vote
1answer
31 views

Get-Item behaving weird returns [PSCustomObject] instead of item but sometimes working fine as well

I am trying to get a media item using the below, most of the times it works perfectly fine for me, however sometimes the same Powershell returns [PSCustomObject], instead of the media item. Sometimes ...
2
votes
1answer
104 views

Getting unknown error while fetching media item using powershell sitecore

I was trying to get media item using media ID. I am getting the below error which I haven't faced before in powershell sitecore. Scenario $ImageId - {61630AC1F0E3111B9C50CEEE0B2B0223} I am using the ...
0
votes
1answer
58 views

Regex to Uncomment an image tag from the rich text editor field using Sitecore Powershell

What I am trying to achieve here is to fetch the HTML within a rich text editor and I need to uncomment all the img tags which are commented within that HTML. I don't want any other HTML code to get ...
2
votes
0answers
87 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
48 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....
-1
votes
1answer
172 views

How to remove specific DIV tag from HTML value of a sitecore field using powershell

I want to remove the below tag from an HTML object containing the sitecore field value in the form of HTML. I want to remove this and set back the remaining HTML in the same field. <div class = &...
0
votes
1answer
64 views

SPE remoting throws error 'You cannot call a method on a null-valued expression.' on calling Invoke-RemoteScript

I installed Sitecore Powershell extension 5.1 on my sitecore 9.0.2 which is in azure PaaS. The imported SPE remoting module 5.1 to my windows powershell(5.1) on my local machine. I enabled remoting ...
0
votes
0answers
27 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 - ...
1
vote
1answer
116 views

PowerShell script to get data from Solr and Edit in Sitecore

Is there a way that i can Query Solr to get data based on a template. Then foreach of that data do a Sitecore Getitem and Update a field's value.
0
votes
0answers
62 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/...

1
2 3 4 5 6