Questions tagged [powershell-extensions]

Anything related to the Sitecore PowerShell Extensions (SPE) module

Filter by
Sorted by
Tagged with
0 votes
2 answers
29 views

How to read Item's media field properties using SPE

I have an item where we have a "Article Thumbnail" field(Media type) and an image is inserted from Media Library. Now I need to check for Alt text in Item's media properties. I am trying ...
0 votes
0 answers
14 views

Sitecore + Powershell (SPE) Migrate content data between two sites with different structures [closed]

I've been working on a migration of data between two separate sites being held in Sitecore. The Original site has an existing structure and a variety of particular pages and resources that I want to ...
1 vote
2 answers
33 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
0 votes
1 answer
30 views

how to set an item Image field

Using Sitecore PowerShell Extensions I can set an item's text properties but an Image property cannot be set: In the screenshot above, setting the Title property worked but none of the attempts at ...
  • 125
0 votes
1 answer
45 views

Get users from 7.2 - throwing error in Sitecore PowerShell

I am using 7.2 Sitecore version. There I need to fetch users using PowerShell script. I have tried multiple combinations or filters to run for instance - Get-User -Filter * I get an error saying - ...
  • 21
0 votes
1 answer
42 views

Sitecore PowerShell Select item at Show-ListView has no delete action

I need to find media items that has no references, but user should have an option to delete them manually . by some reason, if I add an item to custom noRefeItems, Show-ListView component does not ...
0 votes
1 answer
26 views

Sitecore Powershell to change Sitecore Item Fields Value by CSV File [duplicate]

How to change Sitecore Item field value by csv file with Sitecore PowerShell script . As I have a Title property to be change for thousand of items in Sitecore Media Library. So I want to export ...
0 votes
2 answers
31 views

Sitecore powershell script to change WorkFlow Status to Approved from particular node

How to write sitecore powershell script to change WorkFlow status to Approved from particular Media Library Folder. I have multiple documents to replace in bulk in Sitecore Media Library and have ...
1 vote
4 answers
110 views

Get link details in powershell script

I would like to get all the links details inside teaser ,richtext editor components etc through Powershell script. Is it possible through Powershell script ?
  • 327
0 votes
1 answer
49 views

Can I disable dates before mm/dd/yyyy on the Read-variable dialog?

The official SPE docs does not provide the available option parameters for every field type on the Read-Variable command, so I’m curious if it is possible to block of dates before a set date on a date ...
  • 313
1 vote
1 answer
41 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 ...
1 vote
3 answers
72 views

How to get media library item names in csv which has file extension .pdf, .doc and .xls?

I am looking for a solution to list items in the media library with file extensions pdf, doc, and xls followed by exporting to a csv.
1 vote
1 answer
73 views

Azure Command not working in PowerShell module with Sitecore 9.3

Trying to upload a CSV to Blob. Using Sitecore 9.3. Sitecore PowerShell module is throwing the below error: New-AzStorageContext : The term 'New-AzStorageContext' is not recognized as the name of a ...
  • 427
0 votes
1 answer
38 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 -...
0 votes
2 answers
59 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 (...
0 votes
1 answer
38 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 ...
  • 1,168
1 vote
1 answer
52 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,168
0 votes
1 answer
66 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 ...
0 votes
1 answer
31 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 ...
0 votes
1 answer
39 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 ...
  • 120
0 votes
2 answers
78 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
1 answer
44 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. ...
  • 3
0 votes
2 answers
96 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 ...
  • 1,168
0 votes
1 answer
63 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 ...
  • 153
1 vote
1 answer
48 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 ...
  • 117
1 vote
1 answer
63 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 ...
  • 4,751
0 votes
2 answers
83 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 ...
  • 153
0 votes
2 answers
102 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 ...
  • 153
1 vote
2 answers
136 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?
  • 153
0 votes
1 answer
86 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 ...
  • 3
0 votes
2 answers
76 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,...
  • 427
0 votes
1 answer
89 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....
0 votes
2 answers
90 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 $...
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 ...
0 votes
2 answers
60 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 $...
1 vote
1 answer
79 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
2 answers
137 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?
1 vote
1 answer
63 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 ...
1 vote
2 answers
135 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 ...
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 ...
1 vote
3 answers
278 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 &...
  • 327
1 vote
1 answer
53 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
77 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
85 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
3 answers
193 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
1 answer
88 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
228 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
65 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 ...
0 votes
1 answer
155 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 ...
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"?

1
2 3 4 5
8