Questions tagged [powershell-extensions]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
169 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
816 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 ...
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
718 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
86 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
422 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
845 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
496 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
262 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
981 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
278 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
399 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
776 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
296 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
179 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
321 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
553 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
645 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
614 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
664 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
641 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
622 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
772 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
790 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
676 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
214 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
350 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 ...
0
votes
1answer
706 views

“Cognifide.PowerShell.SitecoreIntegrations.Applications.PowerShellConsole,Cognifide.PowerShell” not found Error while opening Sitecore PowerShell

When we try to open Sitecore Powershell console or ISE after fresh installation on one of the Sitecore instances, we receive below error : Log Entry for this error is: 3572 06:48:51 WARN Could not ...
7
votes
1answer
563 views

Sitecore Powershell Extensions - Reports Authorization

I've created some PSE scripts to give our client some reports on their content. I created them under the proper convention of Script Module and Script Library so that the reports show up under ...
4
votes
2answers
807 views

Create Sitecore Link with Powershell

I'm working on some reports using Sitecore Powershell Extensions. One requirement is to provide the public URL for various Sitecore items. I'm thinking this isn't really possible via Link Manager ...
5
votes
1answer
124 views

How to use multiple words in Quick filter box in Sitecore powershell Show-Listview

I am new for Sitecore Powershell, In the script I am using Show-Listview to display the result and it is providing option to Filter the result data. Powershell doc stating we can use multiple words in ...
4
votes
2answers
726 views

Powershell Extensions - Concatenating Values in Show-ListView

I'm working on an instance that has a custom redirect engine built in. I've been tasked to write a report that can show the redirect items' Sitecore path with the "redirect from" and "redirect to" ...
-4
votes
2answers
350 views

Session Timeout in sitecore powershell

[![Ideal Session Timeout in Powershell console][1]][1] I have noticed this few times before & I have intentionally recreated today to confirm on how console would respond when there is a session ...
5
votes
1answer
140 views

8.1 stopped working after content node deletion. NullReferenceException, Powershell Pipeline Issue?

8.1 won't let us log back in. While attempting to delete a node with ~16k sub-items we couldn't tell whether 8.1 was frozen or still trying to delete. We restarted site/app pool & now can't log in....
3
votes
2answers
1k views

EndEdit() and boolean response

I am trying to enable item level language fallback to all items in my website. The below code snippet is taken for editing an standard field and checking whether the field got edited or not. $Lang = "...
1
vote
1answer
334 views

Mandatory fields with SPE

I'm building a Sitecore powershell script where I'm using Read-Variable to read a few fields. I have added the Mandatory=$true on all of them and it only works for single-line fields but not for ...
4
votes
3answers
601 views

How to Enable Item-level language fallback on all templates in Sitecore 8.x

Presently I'm working on Sitecore 8.1 Update-1. We have enabled Item-level language fallback on shell and website as suggested on Configure language fallback - Sitecore Documentation. It seems after ...
2
votes
1answer
930 views

Displaying Errors from Sitecore PowerShell Using Remoting

Using the remoting capabilities in Sitecore PowerShell Extensions, I'm trying to execute some PowerShell remotely and ensure that any errors that occur display in the local console. How can I do that? ...
1
vote
1answer
348 views

Sitecore PowerShell Extensions switch context language based on site context language

I have a script which loops over different sites in a Sitecore instance. For each site some tasks are done, such as creating and moving items. How can I set the language context for these operations ...
3
votes
1answer
788 views

Turning on Index Viewer for SPE

I have really given it a go before I posted here, but I am trying to turn on the Index Viewer for SPE. The gitbook doco says it exists, shows it not being in the menu, but no info on how to put it in ...
4
votes
3answers
3k views

Sitecore PowerShell Extensions get descendant of an item using a template

I'm writing an SPE script and am looping over my site nodes. For each site node, I want to check if a particular descendant exists and if not then create it. I have the list of top-level nodes, but ...
3
votes
2answers
610 views

How can I migrate all controls on all pages to a certain placeholder?

The layout of our website has been completely overhauled. The old placeholders didn't make sense anymore, so they aren't used in the new layouts. As a result, most content pages are now empty. All ...
1
vote
1answer
634 views

How to connect to a Sitecore instance with Windows PowerShell?

I have reviewed the GitBook and the two blog articles (original and v2) about remoting with SPE, but I've not been successful in executing any commands. Here's an example script I've been trying to ...
4
votes
1answer
451 views

How do you programmatically run a Sitecore agent using Sitecore PowerShell Extensions?

I need to run specific agents on demand. When I try to create a new instance of the agent using PowerShell's New-Object command it doesn't seem to work right.