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

Read Send Email values using powershell

I want to read Send Email save action values, all the Save actions are saved in the Saved Action field of a WFFM form. I am able to find if a form has Send Email save action. $query = "fast:/...
user avatar
2 votes
1 answer
11 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 ...
user avatar
  • 16.4k
0 votes
0 answers
14 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 ...
user avatar
0 votes
0 answers
8 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 ...
user avatar
0 votes
1 answer
35 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 ...
user avatar
1 vote
1 answer
30 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/...
user avatar
0 votes
0 answers
37 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....
user avatar
0 votes
1 answer
47 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 ...
user avatar
  • 139
2 votes
1 answer
67 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....
user avatar
  • 139
0 votes
4 answers
81 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: ...
user avatar
  • 139
0 votes
2 answers
39 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&...
user avatar
  • 139
0 votes
0 answers
22 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
-1 votes
2 answers
59 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
50 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 ...
user avatar
0 votes
2 answers
37 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
0 votes
1 answer
46 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
33 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
0 votes
2 answers
54 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
48 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 ...
user avatar
0 votes
1 answer
49 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 ...
user avatar
0 votes
1 answer
57 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 ...
user avatar
1 vote
1 answer
65 views

Is there a way to enable 'alt text' for multiple images using Batch upload

When uploading multiple images using Batch upload, there is no ability to add alt text at once. Is there a way to allow/add distance alt text to multiple images during upload without having to open ...
user avatar
0 votes
2 answers
74 views

How can I run a powershell that looks for a string with random numbers in the string and replace it?

So I am tasked with looking through all of the html content areas in my content tree and look for this string: "<div id="fpCE_version" style="display:none;">8.5.1</...
user avatar
2 votes
2 answers
72 views

When creating a new solution do I have to run the .\init.ps1 command again to prepare the container environment?

I am going through the Developer Fundamentals training for Sitecore 10 on the SiteCore website. I created a solution prior to starting the training following my companies documentation. When ...
user avatar
2 votes
1 answer
198 views

How to check if item language version exists in Sitecore PowerShell?

I am trying to get a list of items which have created version in "en" language in PowerShell script. I am using the following code: $items = Get-ChildItem -Path $folder -recurse | Where-...
user avatar
  • 77
1 vote
1 answer
80 views

Sitecore powershell bulk edit rich text fields to remove lines

I have a bunch of items with an rich text field from which I need to remove the last line of it's content if it consists of a chain of * (the chains can vary in length, but are always composed by ...
user avatar
1 vote
1 answer
26 views

List of Personalization Rules Conditions and What it Triggers

Is there a way in Sitecore to get a list personalization with it rules conditions and what triggers it? Prefer to use PowerShell if it can be done that way or an OOB method. Thanks.
user avatar
  • 695
0 votes
0 answers
41 views

Powershell script to update the template but to retain all renderings and fields

I need to change the template of multiple items in a folder but need to retain the field values and rendering and layout details. I was able to change the template and retain the field values. But how ...
user avatar
1 vote
1 answer
210 views

Find Pages That Match Template Id and add a Value

Using Sitecore PowerShell Extension (SPE). New to SPE and I am trying to do this: If the template id matches && the item is expired && the content type of "video" is missing =...
user avatar
1 vote
1 answer
39 views

PowerShell-Sitecore-Combine Folders and Files Under One Folder

I have the below code working. $sourceContainer = "/sitecore/content/folder/Home/Topics/To"; $destinationContainer = "/sitecore/content/folder/Home/Topics/From"; Get-...
user avatar
1 vote
1 answer
98 views

Error when running "docker-compose build solution" from sitecore 10 docker guide

I'm at this stage of the guide whereby I'm required to build a solution from custom-images directory. After running docker-compose build solution from the directory, it throws the below error at step ...
user avatar
  • 147
0 votes
1 answer
819 views

AzureRM.Profile already loaded when deploying to Azure

I am trying to deploy vanila sitecore 9.1.1 (XM single) to Azure Paas. For this I am using Sitecore Azure Toolkit and Sitecore ARM templates. Below is the Powershell script I am using. $SCTemplates=&...
user avatar
  • 572
0 votes
0 answers
84 views

PowerShell Passing in List of Values to Function for Predicate Index Filtering

I am trying to build a predicate, but if I don't hard code a value it does not work. I need to pass in a list of values. If I hard code a value the filter works. Any ideas on what I can do to get this ...
user avatar
  • 695
0 votes
0 answers
819 views

Powershell script fail with 'Access to the cloud file is denied' error when trying to install SitecoreAzure.Binder module

PackageManagement\Install-Package : Access to the cloud file is denied At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:9711 char:34 + ... talledPackages = ...
user avatar
  • 1
1 vote
1 answer
112 views

Compare two items and copy missing children using Powershell

Environment: Sitecore 9.2 & SXA 1.9 Scenario: I have two different items and I would like to compare them and copy the missing children from one item to another using Powershell script. Item A (...
user avatar
  • 543
1 vote
1 answer
94 views

Retrieve Rules field using Powershell script in readable format

We are trying to get report using Powershell to list all sub items under one item and some of it's fields. One field in the item is of Rules field type. We are able to fetch RuleSet XML (<...
user avatar
1 vote
0 answers
108 views

Powershell script to update personalization rule

I want to update personalization rule for all the pages which have one common rendering. Is it possible using powershell we can identify the rendering and update personalization rule to target page ...
user avatar
0 votes
1 answer
183 views

Sitecore 9.0.1 installation is failing with Solr 6.6.3

I already have 2 instances running on my machine with Solr version 6.6.2 for POC purpose I am installing Sitecore 9.0.1 instance with Solr version 6.6.3.Solr is installed using the powershell script ...
user avatar
  • 181
0 votes
1 answer
68 views

Is this possible to modify existing PowerShell scripts for Sitecore?

I want to modify any one of the existing default Sitecore PowerShell scripts (in the screenshot below), is there any way of doing it? If yes, then please let me know how this can be achieved?
user avatar
1 vote
0 answers
62 views

Sitecore PowerShell Remoting doesn't work with http://localhost/ and http://127.0.0.1/ addresses

I have Sitecore 9.3 with SXA and SPE 6.0 installed in a Docker container. docker-compose.yml map containers 80 port to 80 on local machine. ports: - "80:80" I have an additional ...
user avatar
  • 3,386
2 votes
2 answers
373 views

Setting Image Properties using Powershell on existing Image Field

I am trying to find a way to change the Properties (Alternate Text) of an image field in an item. Do you know how can I access those image properties using Sitecore Powershell?
user avatar
1 vote
1 answer
77 views

Trigger publish as part of deployment

We have a set up with CM, CD1, CD2. Both CDs have their own 'web' database (cd1 and cd2). We are currently using DevOps to run a powershell script that deploys to each machine. We would like to ...
user avatar
1 vote
1 answer
55 views

MediaCache remove item error during deployment

During deployment on CD server we're first removing complete website from root directory and then adding custom code on top of that through PowerShell script. During this time we're getting below ...
user avatar
6 votes
1 answer
9k views

pywintypes.error: (2, 'CreateFile', 'The system cannot find the file specified while installing Sitecore Docker images

I am following the document https://doc.sitecore.com/developers/100/developer-tools/en/walkthrough--using-the-getting-started-template.html to create a test sample project for Sitecore Headless ...
user avatar
1 vote
1 answer
242 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. ...
user avatar
1 vote
0 answers
86 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 ...
user avatar
  • 111
0 votes
0 answers
27 views

What is the difference between using the Sitecore gutter to unlock an item and using the command button in the Sitecore Ribbon?

I am working on creating an SPE version of unlocking an item in Sitecore I can assign to content editors so an administrator does not have to do it. Unlocking an item using the Sitecore ribbon seems ...
user avatar
4 votes
2 answers
696 views

SItecore 10 docker build solution issue - Invoke-Expression

I am trying to follow sitecore 10 example in docker (https://containers.doc.sitecore.com/docs/build-solution) and as an out of box step worked correctly, I am having issue on step 6 with build ...
user avatar
  • 171
0 votes
0 answers
29 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 ...
user avatar
0 votes
1 answer
159 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 ...
user avatar