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
2answers
162 views

Powershell Script error

I am trying to import csv file to content data via power shell script.am getting following error message New-UsingBlock : Item '/sitecore/content/Web3/Content Shared Folder/Property Page' is ...
2
votes
3answers
997 views

Running PowerShell scripts without using Sitecore PowerShell Extensions module

We are facing some issues with Lucene during installation of PowerShell Extensions module (SPE). Is there any option to run Sitecore scripts from Windows PowerShell? I mean that I will just add ...
0
votes
1answer
328 views

Is there any way to tell when an item revision was published using PowerShell Extensions? [duplicate]

Is there any way to tell when a particular revision of an item, or version, got published? I can see standard fields for created and edited date-time, but publishing copies these fields to the web DB. ...
4
votes
3answers
1k views

Update fields using Sitecore Powershell Extensions

I'm using the following script to update a specific field in all the children of the item right-clicked in my content tree. It works but the update is not applied to the item clicked with my context ...
1
vote
0answers
109 views

PowerShell find-item doesn't return values

I'm currently using find-item on Sitecore PowerShell Find-Item -Index sitecore_master_index -Criteria @{Filter = "Equals"; Field = "recipe id"; Value = "Recipe_Lambada"}, @{Filter = "DescendantOf"; ...
2
votes
0answers
214 views

Security disabler doesn't operate in context of Unlock-Item comandlet?

Writing a script to allow editors to unlock an item locked by another user I used New-UsingBlock(New-Object -TypeName "Sitecore.SecurityModel.SecurityDisabler"){ $item | Unlock-Item } This didn't ...
0
votes
1answer
181 views

Sitecore PowerShell Extensions Remoting variables not working in Octopus Deploy

I'm having issues with variables when using SPE Remoting with OctopusDeploy, where method-local variables can't be used. I get this error The value of the using variable '$using:propertyTableKey' ...
5
votes
1answer
239 views

Can a Sitecore LaunchPad button be attached to a Sitecore Powershell script?

I am working on connecting a Sitecore LaunchPad button to a Sitecore Powershell script so I can use the script to perform the desired action. Any examples of how I should do that ?
4
votes
1answer
91 views

How to add keyword to the Keywords-multifield list with SPE?

Trying to add a keyword to the keyword-multilist field with SPE. $items = Get-ChildItem -Path "master:\sitecore\content\Website\site\subnode" -Recurse $items | ForEach-Object { [Sitecore.Data....
2
votes
1answer
322 views

Export of of script results to Excel not working

When I get a ListView with script results, and want to export the results to Excel etc., nothing happens when I click on the buttons. I do however get an error in the developer tools console: ...
1
vote
1answer
67 views

How do I calculate the maximum Index to use with Add-Rendering in a Sitecore PowerShell script?

I have a Sitecore PowerShell script and I am using it to insert a rendering at a particular position on the page. To do this, I am using the [-Index <Int32>] parameter on the Add-Rendering ...
2
votes
0answers
566 views

SPE Remove-Rendering with -FinalLayout Removing all renderings from the Final Layout

I recently wrote my first Powershell script for removing an old rendering from a placeholder and replacing it with a new rendering. For some reason, when the rendering I need to remove is in the ...
5
votes
1answer
355 views

What is the call depth limit in Sitecore PowerShell and can it be overridden?

I have a recursive script that hits a System.Management.Automation.ScriptCallDepthException exception. What is the call depth limit in Sitecore PowerShell and can it be overridden? Note: Yes, I can ...
5
votes
1answer
420 views

How to escape a query in Sitecore PowerShell

This PowerShell query breaks, if the item name contains query operators such as "and" or "child". How should I escape it, so that they don't break it? $SourceItemPath = $SourceItem.Paths.path $...
2
votes
1answer
432 views

How do you add html link to PowerShell Report in each row?

I'm trying to add an html link to each row containing a reference to an arbitrary item. Essentially I want to load a custom item, but it not be the same item as the record. I tested with both scForm....
3
votes
1answer
280 views

Replace or Update Base Template of a Template

I am trying to remove a base template if found and add a different base template if not found. In the code below the standard template is never found even though I know its there. Is it because I'm ...
3
votes
1answer
222 views

Archive Sitecore items using Sitecore PowerShell Extention

I need to archive Sitecore items using Sitecore PowerShell. Any commnand that can be used to achieve this.?
1
vote
0answers
180 views

Use custom Mongo db with Powershell

I have a custom mongo database, that database contains information about pages.I need to query it in order to use SEP to create pages according to that info, ig, adding renderings component, etc. ...
4
votes
1answer
1k views

Display item.Paths.FullPath with Show-ListView command

I have the following script to output to a table certain fields of a selection of items Get-Item -Path "master:" -Query "fast:/sitecore/content/Home//*[@@templateid='{BAC0709D-5606-4A86-AF67-...
1
vote
0answers
84 views

“PowerShell Script Workflow Action”(approve/reject) is not fired from the workbox page on IE browser

"PowerShell Script Workflow Action"(approve/reject) is not fired from the workbox page on IE browser. Whereas it is working fine on chrome browser. None of the buttons(approve,approval all, reject ...
3
votes
1answer
531 views

What is the Powershell syntax for adding and removing items from a TreelistEx field?

I want to edit some Placeholder settings with Powershell extensions, which involves adding a specific rendering to some and removing another rendering from others. Is there a simple syntax based on ...
2
votes
3answers
157 views

Data re-writing from Sitecore 7.2 with SPE

So I need to re-create some content from Sitecore 7.2 to a new Sitecore 8 instance. What we had in mind is to create a script using PowerShell in the new Sitecore 8 instance to fetch the needed data ...
1
vote
1answer
659 views

Bulk create Media Items

Is it possible to bulk create media items from an array of System.IO.FileInfo without needing to install the remote powershell extension package to use the Upload-SitecoreFile command? Notes - The ...
3
votes
2answers
827 views

How to get the current language in a Sitecore Powershell editor (context menu) script?

How can I find which language the editor is currently working in when running a script from the context menu? Get-Item . Returns the item, but in the context language that the script session is in.
4
votes
1answer
1k views

Sitecore powershell - Get the count 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 ...
4
votes
2answers
1k views

Deleting an Item with a null Template

Thru a series of unfortunate events (most likely missing a template in a package between servers/instances) I found myself having issues inserting links thru the General Link field. Tracked it down ...
7
votes
2answers
421 views

How to copy an item to multiple locations

What is the easiest and quickest way to copy an item to various locations? I have about 100 multisites in a solution and I have created a new template. I need to create a new item inheriting this ...
3
votes
1answer
431 views

How to enable non-admin user to use powershell extensions?

I want to enable a specific non admin user to use PowerShell extensions without giving them admin privileges. So far, according to the PowerShell ISE Security Documentation, I have given all the ...
1
vote
2answers
343 views

Update text in a field on user profile

We are on Sitecore 8.1.3 and have a user profile where personal links are stored as a path unfortunately and when the page gets move (not too often) the personal link is broken. For now we would ...
3
votes
0answers
171 views

How to bulk upload media files and set each item's template to custom template?

I have a directory structure that looks like this: -- Folder 1 ---- Folder 2 ------- File 1 ---- Folder 3 ------- File 1 And so on with Folder 1 being the parent folder. When I upload the files from ...
5
votes
0answers
157 views

CI/CD Sitecore challenge: going from “wipe” to “overwrite”

We are set to release a large Sitecore-based system in a week. Presently the CI/CD process works by effectively republishing everything from a git repository as the source (we use TDS for day-to-day ...
4
votes
1answer
156 views

What does the RepublishAll switch do in the SPE Publish-Item command?

I suppose one should take the name of the switch at "face value", but it's difficult when there's already a PublishMode parameter which defines how the command is intended to work. So, I guess more ...
3
votes
2answers
423 views

Sitecore powershell context menu unavailable for content editors

Issue Description The entire Sitecore Powershell context menu is not visible for any content editor. I've tried creating a user and adding every role (except for ones like limited content editor etc)....
6
votes
2answers
498 views

How to hide ribbon in Sitecore

We have created a ribbon in Sitecore that have few command buttons and few PowersSell command buttons. We want them to be visible only when an author hits specific items in the Content Editor. So we ...
3
votes
1answer
391 views

Item.Editing.EndEdit() is not triggering save event when called from Powershell extension

We have written one rule for bucket items and it gets triggered when an bucket item is created or item is saved. for creating an bucket item we use below code $updatedItem=New-Item -Path "$parentPath"...
3
votes
0answers
142 views

New item is not in focused after creation using powershell

When we create item in a Sitecore bucket folder using PowerShell Extensions like shown below: New-Item -Path "$PathofBucketFolder" -Name $TitleofanItem -ItemType $TemplateofanItem Item gets created ...
2
votes
1answer
121 views

Multilist with Search not working with Powershell script

When we use "Multilist with Search" as editor option using powershell extension, it shows multilist without any search. It seems the multilist with search is not enabled. I used below line of code in ...
4
votes
2answers
442 views

Powershell command to get lower directory

I currently have a script that puts a file in a directory the website but would rather create it in the Data directory. The powershell script has the below: $FilePath = $AppPath + "Temp_files\...
1
vote
0answers
154 views

Adding placeholder settings to presentation details of many items

I have to add a bunch of placeholder settings to a bunch of items. These items already have specific presentation details, so not using the standard values. I tried to add them to standard values, ...
3
votes
1answer
166 views

Unable to access child files using physical path [closed]

I have an issue with access child files using Sitecore Powershell script I have created powershell script under /sitecore/system/Modules/PowerShell/Script Library/Tasks to copy files from a ...
4
votes
1answer
774 views

Compare item versions with powershell

I'm looking for an option to compare programatically using SPE all the fields of an item that have changed from the latest version x the version prior to that and highlight what changed. Have anyone ...
7
votes
2answers
8k views

How to check an item exists with powershell without raising an error?

In Sitecore Powershell extensions I can use If ( Get-Item ...) to return true if an item exists or false if it doesn't, but if the item isn't found then it outputs an error message as well. Is ...
3
votes
1answer
684 views

Can I update links retrieved with Get-ItemReference in powershell?

I'm building some scripts that will check that items are localized to a particular branch of the content tree (we have lots of parallel tree structures and we want to copy between them) and can ...
5
votes
1answer
84 views

Are locally scoped objects in Sitecore Powershell released from memory when out of scope?

I'm writing some scripts that will process a large quantity of items and have naturally split out some parts of it to functions. Within these functions I'll get a Sitecore item in a local variable, do ...
0
votes
1answer
413 views

Sitecore Powershell script to find items that break inheritance

I need to write a Powershell script to find items that refer to a specific composite component and break inheritance for presentation. If I go to the Navigation Tab in the Content Editor and click ...
1
vote
2answers
809 views

Replacing Text in strings from SPE Invoke-RemoteScript Return adds many spaces

I am getting an item from Sitecore, then taking the return and messing with the FullName to build the URL. Import-Module -Name SPE $Id = [Some Id] $session = New-ScriptSession -...
1
vote
1answer
483 views

Using Sitecore PowerShell Extensions to Copy Layout Details from One Device to Another

My website is using the App Center Placeholder device on all of the pages. I would like to use Sitecore PowerShell Extensions (SPE) to deprecate the App Center Placeholder device and move all the ...
6
votes
1answer
255 views

Setting up automated role creation for various SXA sites

The challenge I am trying to solve is to create dynamic roles for an SXA site, knowing that my client will be creating multiple SXA sites over time, and thinking that possibly the best way to ...
3
votes
2answers
1k views

Timeout while running remote script using SPE Remoting

I am running the following script using SPE Remoting (trying to find all images on all sitecore sites, but this doesn't matter as it is off subject for this post): Import-Module -Name SPE $session = ...
1
vote
2answers
947 views

Having trouble remoting into Sitecore with Powershell

I’m trying to hit the Sitecore Webservices with the following Script: The following function comes from Sitecore/system/Modules/PowerShell/Script Library/Platform/Functions/Remoting function Set-...