Questions tagged [powershell-extensions]

Anything related to the Sitecore PowerShell Extensions (SPE) module

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

PowerShell script to alter item security inheritance

I am working on SPE code to set user permissions for a specific tree item. $role = "Michael" $path = "master:\content\home\distributors\a-b\Austria" $acl1 = New-ItemAcl -...
user avatar
0 votes
1 answer
33 views

Need to authorize email sending with API instead of SMTP

Security policy is requiring us to update passwords regularly, and this includes service accounts previously in use for services such as SMTP from our web servers. We are looking to use the Gmail API (...
user avatar
0 votes
1 answer
32 views

Scheduled LinkDB rebuid | Success completion

I have used Sitecore scheduler to schedule a Powershell task. The task rebuilds the Link databases of Master and Core. As the tasks are long-running, I am running them as Async. So in the logs, we ...
user avatar
  • 1,108
1 vote
1 answer
31 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 ...
user avatar
  • 1,108
0 votes
1 answer
47 views

Sitecore PowerShell session issue: a script needs to be executed in the session

I am running a script and I am using loop concept to get certain data. But a session timeout error was encountered during the script execution and the script stopped running. Issue: A script needs to ...
user avatar
0 votes
1 answer
26 views

Overwritten Sitecore Powershell Default Module Get-Rendering, How to recover the script block

I was creating custom functions using Sitecore Powershell script. I accidentally gave the custom function a name similar to the Sitecore function (say Get-Rendering). The default function script block ...
user avatar
0 votes
1 answer
37 views

Retrieving "p:after" in layout via Sitecore Powershell Extentions

I am trying to retrieve these values found in the "final renderings" field: p:after and p:before. But I can't seem to find them anywhere. Is there a way to get them out? The reason I need ...
user avatar
  • 120
0 votes
2 answers
35 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 ...
user avatar
0 votes
1 answer
41 views

Is it possible to achieve Sitecore item version? [duplicate]

I want to archive Sitecore item version and not the entire item using Powershell script. I could not find the way to archive version, articles are there to archive item but not the specific version. ...
user avatar
  • 3
0 votes
2 answers
47 views

Access the database by connection string

Context: I am trying to automate a few steps in the existing Sitecore 10.1.1 environment using Sitecore PowerShell. Problem: We have a command Get-Database to access the database either by providing ...
user avatar
  • 1,108
0 votes
1 answer
57 views

How to take content item package with all referenced items using Sitecore Powershell?

I would like to create package of one single content item using Sitecore PowerShell Extensions. While creating the package, I would like to include all the referenced items in the package. Is there ...
user avatar
  • 111
1 vote
1 answer
38 views

Sitecore Powershell Test-Account -Identity breaks with email as username

I am in need to iterate through a list of emails (that happen to be username in Sitecore CMS) and then remove the users. I would like to have an "if" statement to see if account is present ...
user avatar
  • 117
1 vote
1 answer
31 views

How To Upload File To Remote Sitecore Instance Via Web Request

I am attempting to upload a PDF file to Sitecore as a single web request and have it added to the media library. I would like to choose a parent folder and have all requests generate a PDF at that ...
user avatar
  • 4,741
0 votes
2 answers
61 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 ...
user avatar
  • 111
0 votes
2 answers
75 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 ...
user avatar
  • 111
1 vote
2 answers
90 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?
user avatar
  • 111
0 votes
1 answer
55 views

SPE reports - CSV download doesn't work

We have built a powershell report which is working great. However none of the download buttons work. There is no error in browser nor sitecore logs. it just doesn't download the file. I've tried in ...
user avatar
  • 3
0 votes
2 answers
70 views

Sitecore PowerShell Extension script

I need to run a script to extract Sitecore item data. As of now if I use the below script: Get-ChildItem -Path master:/Sitecore/content/Data -Recurse |Show-ListView -Property DisplayName, ItemPath,...
user avatar
  • 395
0 votes
1 answer
61 views

How to select only items in content folder and item datasources using powershell script?

how can I select only content items, items in content folder and Datasources of that items using PowerShell Extension script? $items = @() foreach($baseItem in $listOfPages) { if($baseItem....
user avatar
0 votes
2 answers
57 views

How to check item type Sitecore PowerShell?

How can I check if particular expected item is content and datasources foreach($baseItem in $listOfPages) { $items += Get-Item $baseItem.Paths.FullPath $items += Get-ChildItem $...
user avatar
1 vote
1 answer
83 views

How can I check why component disappears when I add it to placeholder?

when I add content that was previously generated to placeholder of page, the whole component disappears, how can I check where is there error, also the content was created on new language version by ...
user avatar
0 votes
2 answers
53 views

When you copy final renderings, what does happen with the datasources?

I wonder when I copy final renderings, what does happen with the datasource, does this will be copy also datasource or not? New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $...
user avatar
1 vote
1 answer
52 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 ...
user avatar
0 votes
2 answers
84 views

How to get current user role name in Sitecore using Powershell

How can I read the role name of current logged-in user in Sitecore PowerShell Module?
user avatar
1 vote
1 answer
58 views

Sharing data between two powershell scripts

I have two scripts namely, Add and Report. I am having a array of items in Add script. I want to read this array in Report script. Add script can be called multiple times. I want to retain the value ...
user avatar
1 vote
2 answers
105 views

How to update Item's Media Properties using SPE (Sitecore Powershell Extensions)

I have an Image Field in an Item. When the image is uploaded to Media Library, the Alt field is not updated and hence when we look at the Image properties from Item, it is Blank. So far so good. The ...
user avatar
0 votes
0 answers
15 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
1 vote
3 answers
220 views

Get Sitename through PowerShell script

I would like to get SXA Site name dynamically when we run PowerShell script through the context menu. Currently I am giving static Site name in PowerShell script. Using the below code. Show-Input &...
user avatar
  • 187
0 votes
1 answer
44 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
58 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
64 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
3 answers
120 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
1 answer
73 views

How to copy images included in content using Sitecore PowerShell Extension

I would like to know how to copy Sitecore Media Library content from Sitecore page one language to second language?
user avatar
1 vote
2 answers
179 views

How to enable multiselect in dialog prompt?

how to set up multiple select on the Sitecore PowerShell interactive dialog? Thanks
user avatar
2 votes
1 answer
57 views

In SPE how can we assign dynamic hashtable to Read-variable options for checklist editor

I have a requirement to show list of options as checklist to user for selection. If followed In Powershell how to enable/show options like Select All | DeSelect All for Multilist field type , it have ...
user avatar
0 votes
1 answer
119 views

Need sample Sitecore PowerShell script to add components to any SXA page dynamically

We are looking for a Sitecore PowerShell script using which we can assemble/add components directly to an SXA page. I am able to add an SXA page, then add a Container component (under the page ...
user avatar
0 votes
1 answer
31 views

How do you programmatically change the "Quick Action Bar" of a template to "Required" using PowerShell? [duplicate]

Can someone please provide an example using SPE to set the field "Quick Action Bar" of my templates to required "Required"?
user avatar
0 votes
2 answers
116 views

Change field type via a Powershell Script [closed]

I have created a custom field type which inherits from general link but has an extra attribute we need. We only want it to be used for a particular microsite. Now I want to write a script so that I ...
user avatar
  • 554
0 votes
2 answers
139 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
0 votes
1 answer
155 views

Get-Item path not working as expected

Can anyone explain what's going on here with this Sitecore Power Shell script? We have 2 websites set up on 1 Sitecore instance, they're as follows: /sitecore/content/siteA /sitecore/content/siteB ...
user avatar
  • 25
1 vote
2 answers
79 views

How we can update droptree value of an item using PowerShell query

Does anyone know how to Update droptree field values through Powershell? We have the bulk of items, which one of the field values as __Workflow state under workflow section[while we can see enable ...
user avatar
  • 435
2 votes
1 answer
449 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
0 votes
0 answers
45 views

Azure AD login triggered for powershell script

We are working in Sitecore 9.3. In the CM instance, we have configured a site as well for internal business users. The site uses Azure AD B2C for login using WsFederation. We are able to login to ...
user avatar
0 votes
1 answer
90 views

Powershell Reports menu not appearing

We upgraded a Sitecore site from 9.1 to 10.2. After the upgrade we installed the latest SPE. Everything works as expected except the SPE Reports submenu; it doesn't show, even for the admin user. We ...
user avatar
  • 1,632
0 votes
1 answer
111 views

How do we get list of items in a workflow using powershell script

I need to get list of items/pages and all its associated contents in a workflow using the powershell script. Is there any possibility to achieve the same?
user avatar
2 votes
1 answer
26 views

How do you copy Latitude Longitude from the old SXA fields to the new Coordinate fields?

We are upgrading from an older SXA for Sitecore 8.2.7 to SXA 9.3. We would like to keep the Latitude and Longitude values intact but we have hundreds of items with this data. How can I migrate these ...
user avatar
  • 16.6k
1 vote
0 answers
152 views

Getting this error after installing PowerShell v6.3 Type "Cognifide.PowerShell.Client.Controls.IsePluginStrip, Cognifide.PowerShell" not found

I am hoping to understand the cause of this and hopefully find a solution - I have looked at every possible solution, but haven't been able to fix it. Sitecore v10.0.2 using PowerShell v6.3. I have ...
user avatar
  • 97
1 vote
4 answers
303 views

How to Get Items from the specific folder with specific TemplateName in Parameters

How to get the items with specific template only. I need this, beacuse it is useful for the bucketable items, like Tags Here is my code: $props = @{ Title = "Test" Description = &...
user avatar
  • 349
1 vote
1 answer
83 views

How to compare two MultiList Selected Values

I want to compare two MultiList in terms of, comparing Selected Items. I have a MultiList where users can select what items they want to be selected. Here is the image of it: Now I have a Tagging ...
user avatar
  • 349
1 vote
1 answer
171 views

How to get value from the MultiList Field and Get Path to Tag Repository

I have a little bit of confusion regarding the Multilist Field in Sitecore. Basically, I want to get all of the selected MultiList Field in PowerShell to do stuff with them. Is it possible to make ...
user avatar
  • 349

1
2 3 4 5
8