Questions tagged [powershell]

Issues relating to the PowerShell scripting language. This can include the stand-alone PowerShell scripts run from the command-line, or PowerShell DSC install automations.

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

Get Item current language doesn't work for the multiple language sitecore instance [closed]

I have multiple languages from my instance but when i change the language and preview to download the file it fetches the data from English language and not the specified language.
3 votes
2 answers
39 views

How to set Analytics Tracking Event as download using Sitecore Powershell script

I'm trying to set Analytics Tracking Event as Download using Sitecore PowerShell script for most media items which have pdf extension. like this: Below is the script, I have written but not working $...
-1 votes
1 answer
54 views

Is there a way to link a Powershell script to a custom button?

I'm trying to run a PS script I made via custom buttons. The scripts must be loaded from Sitecore Script Library (/sitecore/system/Modules/PowerShell/Script Library) The script runs perfectly if I run ...
  • 229
1 vote
1 answer
197 views

PowerShell special characters encoding

I've built a PS script to create and populate items from a CSV file. The issue is that chars like ä, ü, ö are replaced with � in the field values. I've changed the encoding from ConvertToDynamicObject(...
  • 229
0 votes
1 answer
46 views

Sitecore Razl Script connection error

I am starting the Sitecore Razl scripting and trying to get an item by using script as mentioned in the documentation. https://hedgehogdevelopment.github.io/razl/script.html So my script goes like ...
1 vote
3 answers
426 views

Powershell script to get the list of items created/modified on particular day

We would like to pass the particular day and get the list of items changed on that day. Do we have any PowerShell script for that?
  • 309
0 votes
1 answer
64 views

The term 'Write-SitecoreDockerWelcome' is not recognized as the name of a cmdlet, function

We're trying to init docker on a new dev machine however we're running into issues... it appears that sitecore docker tools is not installing? The error is Installing SitecoreDockerTools... Importing ...
  • 238
-1 votes
2 answers
153 views

Rename items with specific name in my Sitecore content tree using PowerShell script

I want to rename items with specific name in my Sitecore content tree using PowerShell script to a new name. I tried the following but no change- Set-Location -Path master:\content\HyperLocal\Arena\ $...
  • 11
1 vote
3 answers
97 views

Unable to read Rendering Parameters template fields using powershell

There is a page template called X being used to create a number of pages. There are two renderings A and B being used on many pages that created from X page template. Now I want to set the one ...
0 votes
0 answers
22 views

Change non-existent template id of a content item to a new template id via Sitecore Powershell or DB Browser without data loss [duplicate]

It is basically a SXA Sitecore 10.2 site, I wish to change the template id of Settings in the content tree through Powershell Console or DB Browser. Since I am not able to select the item and change ...
  • 57
1 vote
1 answer
79 views

How to take item package of particular time period using Sitecore Powershell?

We are working on Sitecore Upgrade and would like to merge the item changes for the particular period. If we try to use item dynamic package, it is taking longer time and timed out somewhere. Is there ...
  • 309
2 votes
1 answer
81 views

Where is Production.ps1 script in Sitecore docker images?

This document https://www.sitecore.com/knowledge-center/getting-started/docker-entrypoints describes two PowerShell scripts used as ETRYPOINT, named Production.ps1 and Development.ps1. They should be ...
2 votes
1 answer
76 views

Run PowerShell script using Gulp?

Is there any way to run a PowerShell script in Sitecore using Gulp? We are trying to integrate some content publishing to the build process automatically. All our JS/CSS is stored in the Media Library ...
1 vote
1 answer
45 views

PropagationType in Sitecore powershell scirpt is not working

I was trying to deny write access to Everyone role for my Sitecore Content tree nodes. There are many nodes and lot of items have write access for Everyone user , which we want to restrict now. I ...
1 vote
2 answers
58 views

Get Teaser component SXA style in Powershell script

I would like to get selected SXA style of the Teaser component in Powershell script. I have a teaser component where i have selected SXA style on Experience editor . I would like to get selected SXA ...
  • 339
1 vote
2 answers
103 views

Getting the datasource Location of all Renderings 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., The script ...
  • 11
1 vote
1 answer
84 views

Can't download any results from Show-ListView

I've written a script to generate a report that allows downloading a list of pages and relevant tags applied to them (within a section). In that script, I wrote the below code to download the output. ...
1 vote
1 answer
170 views

Docker service 'cm' failed to build

I am setting up the Sitecore project with docker and getting the following error : Service 'cm' failed to build: Build failed While running the docker-compose build in the Powershell script. The ...
0 votes
1 answer
121 views

Installation Error : Sitecore 9.1.0

I am installing Install Sitecore 9.1.0 using PowerShell script and getting the following error: Unable to connect to target server. Please verify the connection information such as the server name, ...
1 vote
1 answer
86 views

Copying Renderings , Final renderings for multiple items using powershell fails randomnly on few items

We have set Presentation Details on template's Standard Values. I dont want these standard value renderings in my existing page, as we have correct renderings in existing pages and I want this ...
0 votes
0 answers
31 views

How do we update layout details in template's standard values without affecting existing pages?

I have a situation where I need to set correct controls in layout- presentation details for my template standard values, without affecting the existing pages which uses the template. We have manually ...
1 vote
1 answer
131 views

Sitecore PowerShell Remoting: how to

Environment details: Sitecore 10 Azure PAAS hosting I am trying to automate a few things in an already running Sitecore set-up. For that, I wanted to utilize Sitecore Powershell remoting. I have gone ...
  • 1,268
0 votes
0 answers
18 views

Powershell to read WFFM droplist

I am using Sitecore 8.2 and trying to read the WFFM droplist field items and selected values using powershell. The droplist field has Localized Parameter where the items and selected values are stored....
0 votes
2 answers
448 views

How can I count all existing versions of an item in Sitecore Powershell Extensions?

When I go to the content editor I can see that the Home item has 81 versions, but when I'm counting its versions in Sitecore Powershell Extensions I'm getting 79 versions as a result. What am I doing ...
0 votes
2 answers
132 views

How to take list of http:// or https:// link referenced in our Sitecore content tree using Sitecore Powershell?

I would like to take a list of external links (http:// or https://) referenced in our website from our Sitecore content tree. I need to compare with all Sitecore Fields(Rich text, general link, single ...
  • 309
0 votes
2 answers
196 views

How to add new version before updating the field values using Sitecore Powershell?

I have to update field values to a particular item. Instead of changing the item's final version, I would like to create a new version and do my updates. For ex: if en(v2) is the latest, I need to ...
  • 309
1 vote
2 answers
338 views

How to update the anchor link text in rich text field using Sitecore Powershell?

I would like to update the anchor link text, if the anchor link Href match with particular domain/url. Do we have any sitecore powershell script to update the same?
  • 309
1 vote
1 answer
195 views

How to use Where-object in Show-ListView Expression

I have a list(list 1- $itemModes) which contains following fields, class Mode { [string]$WorkflowName [string]$WorkflowId [string]$ItemId [string]$ItemName [string]$InstallMode ...
0 votes
1 answer
177 views

How to loop selected pages in PowerShell model Treelist

I am using Sitecore Powershell Module, to select list of pages that can be later on translated and created new item. I am using this block of code @{ Name = "listOfPages" ...
2 votes
2 answers
114 views

Moving Item from a Bucket into another Bucket doesn't keep the item into Bucket structure

I have a requirement where I need to get items from a Bucket and move them into another Bucket. When I manually move the item using MoveTo from the menu, it works fine and shows a perfect tree ...
  • 3,394
2 votes
1 answer
46 views

PowerShell Remoting not working with an Azure VM

I'm trying to connect to a VM hosted in Azure and for some reason the remoting connection never established like you would typically see while on a corporate network. Things I've checked: Enabled PS ...
  • 17.3k
0 votes
0 answers
16 views

Getting New-Item : AddFromTemplate - Add access required when trying to add new workflows [duplicate]

I have written a SPE which would create a workflow on button click. This is working fine with admin account. If content author is trying to create a workflow then its giving following error, and the ...
0 votes
0 answers
38 views

XML Exception during ConvertTo-SCModuleWebDeployPackage command execution

I am getting a xml root is missing execption when I run the ConvertTo-SCModuleWebDeployPackage command. I have all the prereqs installed such as MSWebDeploy, SQL server, DacFramework, the sitecore ...
1 vote
1 answer
80 views

Import-Item now working on other directory files

I have exported items using Export-Item command to a specific path in Data folder say, "websitepath/data/batch/userGivenName", please refer my previous question How to copy selected items to ...
1 vote
1 answer
123 views

How to copy selected items to a Data folder using powershell script?

We have a requirement for bulk workflow approval. Where we need to add items(with or without children) similar to this image, Following this article, https://www.sitecorenutsbolts.net/2015/12/14/...
0 votes
0 answers
150 views

Is there a way to add check box to powershell reports to select or unselect the items from report?

We have a requirement,to show list of items with checkbox to select or unselect the items. Like this, I have tried dialog box with checklist editor by referring to following articles, https://www....
0 votes
1 answer
302 views

Add script in Item context menu

I would like to add PowerShell script on the home item context menu. I have added in Script library by creating a Content Editor followed by a Context menu folder. However, it is not showing the ...
  • 339
2 votes
1 answer
120 views

Not publish item after moving its workflow state through PowerShell script

I am moving workflow state through Powershell script to approved state. However, it is not publishing that item in the web database. Code:- $item.Editing.BeginEdit() $item.__Workflow=$workflowId $item....
  • 339
0 votes
4 answers
239 views

Get workflow id in Powershell script

Can we get workflow id if we have workflow name in Powershell script? Scenario 1: I have workflow name "Test workflow" based on its name can I get its id in Powershell script? Scenario 2: ...
  • 339
1 vote
2 answers
614 views

Get dropdown values through Powershell script

I am using the below code in PoweerShell script:- $options = @{ "A"="a" "B"="b" } $props = @{ Parameters = @( @{Name="selectedOption&...
  • 339
0 votes
0 answers
24 views

How to get root path in selected item path using Sitecore PowerShell? [duplicate]

how to get root path xxx in selected item path using Sitecore PowerShell master:/sitecore/content/XXXX/Home/Contact
user avatar
0 votes
4 answers
2k views

How to get path property of Sitecore item using PowerShell

how can I get path property of Sitecore item using PowerShell module?
user avatar
0 votes
3 answers
465 views

Moving item using in Powershell

Is there a way to move item using ID in powershell. I know there is a way to Move item using path Move-Item -Path $_.ItemPath -Destination $destinationContainer; But in my scenario, the path is same ...
0 votes
2 answers
357 views

How to get template id of selected article page item using Sitecore PowerShell?

I wonder how can I get Template Id of selected article page using Sitecore PowerShell?
user avatar
1 vote
1 answer
157 views

How can I get link fields content copied to another language version using Sitecore PowerShell Module?

when I create new language version item of content using: Add-ItemLanguage -Item $imageItem -Language $baseLang -TargetLanguage $targetLang -IfExist OverwriteLatest content page link field ...
user avatar
0 votes
1 answer
147 views

How can I create new language version for linked items using Sitecore PowerShell Extensions?

How can I create new language version item for linked items of page using Sitecore PowerShell Extensions? Script for items language version creation: #Create new items with new language function ...
user avatar
1 vote
2 answers
484 views

How to get all image field that is included in a page using Sitecore PowerShell and create new language version for images

I would like to know how to get all related media id's from page using Sitecore PowerShell module and create new language definition for media items. So we have a page that have image field in data ...
user avatar
2 votes
1 answer
110 views

Creative exchange object null reference error

We have upgraded to Sitecore 10.1 from Sitecore 8.2. The Creative Exchange feature is giving object null reference error in web database when creating a new site using powershell script. How to ...
0 votes
1 answer
72 views

A non-interactive client login to Experience Editor (Sitecore 9.3)

I am writing a service tool where I need to invoke a web request to Experience Editor page from command line. I need to authorize the request with Sitecore user. How can I do this? I found some ...
0 votes
1 answer
151 views

Looking for powershell script that looks through Template files and updates them

So we have added multiple publishing DBs on our system that have an error deploying template files on deployments. I have a feeling its because the "Publishing Targets" are blank. When I ...