Questions tagged [powershell-extensions]

Anything related to the Sitecore PowerShell Extensions (SPE) module or general Windows PowerShell.

Filter by
Sorted by
Tagged with
1
vote
1answer
769 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
1k 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 ...
5
votes
2answers
2k 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
444 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
522 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 ...
2
votes
2answers
406 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
193 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
169 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
179 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
473 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)....
7
votes
2answers
547 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
452 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
1answer
184 views

New item is not in focused after creation using powershell

When we create an item in a Sitecore bucket folder using PowerShell Extensions like shown below: New-Item -Path "$PathofBucketFolder" -Name $TitleofanItem -ItemType $TemplateofanItem The item gets ...
2
votes
1answer
128 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
519 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
160 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
182 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 ...
5
votes
1answer
875 views

Compare item versions with Sitecore PowerShell Extension

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 ...
8
votes
2answers
9k 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
777 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
88 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 ...
1
vote
1answer
446 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
898 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
536 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
270 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
1k 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-...
7
votes
1answer
299 views

Exporting database-based media to the file system

There's a great article (Sitecore 8.2 - Convert disk media to database) on converting disk media to the database, but I'm trying to do the opposite, temporarily at least. I want to optimize images (...
13
votes
3answers
2k views

Sitecore Powershell query for big images of a certain size

Can someone help me with the Sitecore Powershell query which I can use for finding the images more than the given size.
4
votes
3answers
409 views

Script to identify largest gap(s) in content entry over a period of time

One of our clients has reported an issue wherein after our most recent deployment some of their content appears to have gone missing and/or been reverted. I'm not looking for a way to find out the ...
4
votes
1answer
845 views

Sitecore LinkManager in PowerShell generate wrong protocol

I have next powershell code for getting page url by item function Get-ItemUrl($item){ $urlOptions = [Sitecore.Links.LinkManager]::GetDefaultUrlOptions() $urlOptions.AlwaysIncludeServerUrl = $...
3
votes
1answer
313 views

How to display dialog before call powershell script?

I need to have a dialog box with 2 dates at sitecore 8.2 admin page, and call sitecore powershell script with parameters that came from dialog box ? what is the best way to do it ? it seems like SPEAK ...
10
votes
2answers
1k views

Updating Workflow for all the Items in Sitecore Instance

I would like to update a workflow (any Standard Field) for all existing items. new items. What is the best way to do this? Can I use Sitecore Rocks or Sitecore Powershell Extensions? Any other ...
2
votes
2answers
188 views

Sitecore Powershell - Getting Error “ProviderPath is already present”

In Sitecore Powershell while running simple command like get-item or get-childitem i am getting following error. Get-Item : The member "ProviderPath" is already present from the extended type data ...
4
votes
1answer
346 views

Sitecore Powershell Workflow Actions Not Executing

I have been working to get a Powershell script to execute through a workflow action in Sitecore and I'm running into an issue. Previously I was able to insert a new Powershell action from the provided ...
2
votes
1answer
580 views

Sitecore Powershell Get-Rendering doesn't find any renderings from Context Menu, but works in ISE

I have a script that copies a page with renderings from a set language to 1 or more other languages that are selected by checkboxes. The whole script works when i run it in the ISE, but when I run it ...
6
votes
1answer
704 views

Updating parameters using SPE

I'm running a script in which I want to mark as checked all renderings of a specific template with the Vary By Data parameter. But running the script it is adding to the Additional Parameters the ...
2
votes
1answer
667 views

SPE prevent Get-Item from throwing error if no item found

I'm writing a script to show the missing/new items between two content branches. For the target of the comparison, I build an item path and then call Get-Item on that path to see if there is an ...
2
votes
2answers
708 views

Reattach images to media library items after optimization?

I was able to download all the legacy image files in my media library via an ASP.net script (https://gist.github.com/DaveGoosem/6289015), in order to optimize them. I've finished doing this and now ...
3
votes
1answer
685 views

SPE - Get list of installed media item [closed]

Currently, I have been using the following code to display the Upload Advance Dialog for media files: $itemPath = Get-Item "master:\media library\Files" Receive-File ($itemPath) -AdvancedDialog The ...
1
vote
1answer
634 views

SPE - Cannot index into a null array

I am trying to pass an Item to a SPE Function as follows: function ImportTask ($importTask, $taskItem) { $taskName = $taskItem.Name $importTask.ItemTitle = $taskItem.Fields["Item Title"]....
3
votes
1answer
3k views

Why is Get-ChildItem not working

I am trying to write a script to loop through child items using the Get-ChildItem cmdlet but it does not seem to be recognised. $path = "master:/sitecore/content" $x = Get-ChildItem $path Write-Host $...
7
votes
2answers
825 views

Sitecore Powershell: Is it possible to prompt user for their password?

I'm creating a Context Menu script to allow deletion of languages on my content tree. When the user elects to run this script, I want to prompt them for their password as a confirmation mechanism, ...
2
votes
2answers
1k views

How to get list view of items plus their linked items in powershell-extensions?

I have a list of items /{path}/ORG[1-n] which each use a multilist field "Countries" to link to multiple country items. This is a many to many relationship. ORG1 and ORG2 may both link to Country1. I ...
6
votes
1answer
835 views

Set Powershell script language

I would like to know if there's a way to set the current script's context language through code. I know there's a way to set it in the ISE but I need some code that could override it and force a ...
11
votes
4answers
2k views

Copy final layout to shared layout

Our content authors, makes a lot of mistake when whey work in Experience Editor. Quite often they do some changes on final layout, but expect to have it on shared layout. Is is any tool exist that ...
3
votes
2answers
716 views

Unlocking items via Sitecore PowerShell Extensions scheduled task

I'm using Sitecore Powershell Extensions to unlock items that have been locked for an extended period of time. The script is stored in the script library: $item = Get-Item -Path master:\content\ $...
2
votes
1answer
223 views

Get back to 'PS master' location in Sitecore powershell console after error

How to get back to master database location in sitecore powershell console when there is an exception while executing script. We all know that default location when we open sitecore powershell ...
3
votes
1answer
364 views

Show-Listview shows Item Id instead of Field Id

We're using Sitecore PowerShell Extensions to generate some reports. In one of our templates we have a field with the name Id. This id field is not being listed correctly by PSE because it is ...