Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [powershell-extensions]

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

1
vote
0answers
13 views

SPE Object reference not set to an instance of an object

In Sitecore 9.02 I get this error running any script in Powershell ISE. Console works fine. Stack trace: [NullReferenceException: Object reference not set to an instance of an object.] Cognifide....
5
votes
1answer
158 views

How do you change the sort order of items using PowerShell

I have some items created using New-Item but they are automatically sorted alphabetically. I would much prefer these items to be sorted by Created date. How do you change the sort order of items ...
0
votes
0answers
20 views

How to copy multiple pages and update the component's path with the new location

Would like to copy multiple pages from one location to another and update part of the path for the components associated. All other details such as folder structure, Item names, versions will be ...
3
votes
1answer
26 views

How to copy multiple items to a new location

Got over 200 items in various folders in one location that would like to copy to a new location while retaining the same folder structure. Each item has more than one version and would like to retain ...
1
vote
1answer
97 views

How can I specify a specific log file to write to from a Sitecore Powershell script?

I have some scripts where I'd like to separate their log output from the standard Sitecore Powershell log (SPE.log). Is there a parameter which I can use on Write-Log to output to a named log file?
1
vote
1answer
26 views

Reading a CSV file from media library through power shell script

This is working fine $global:ProductPath = "/sitecore/content/Home/Content_Pages/ " $csv = Import-CSV "C:\inetpub\wwwroot\mysample\Book1.csv" $bulk = New-Object "Sitecore.Data.BulkUpdateContext" try ...
2
votes
2answers
56 views

Is it possible to edit the InsertItems of an item

I have managed to get a list of items that use a specific template. I now want to add an Insert option to each of those items. I understand that I can edit the template Insert options and update the ...
2
votes
2answers
107 views

Powershell get all items that use a template

The title pretty much says it all - I've looked at the docs but I just keep finding Get-Item and Get-ItemTempate. Lets say I have a template with id 123456, I want to get all items that are using ...
0
votes
2answers
41 views

Getting all items using a Specific Sublayout using Sitecore Powershell Extensions

I have to get data of rendering parameters used by a specific sub-layout. Is there a way to get all items which are using a particular Sublayout. Example: I have a Sublayout "SiteHeader" and it has a ...
0
votes
0answers
39 views

Sitecore PowerShell Extensions Get-Member returning nothing

Was trying to use SPE-Remoting module. 1) Installed SPE [Sitecore PowerShell Extensions-4.7 for Sitecore 8.zip] 2) Created local setup using "SPE Remoting-4.7", just used video https://www.youtube....
2
votes
1answer
43 views

How to get detailed installation log while the update package is being installed remotely using SPE?

I'm using SPE to install the TDS .update package file. How do I get detailed installation log remotely in the script below? Current PowerShell Script: $SitecoreInstanceUri = "https://helixsite....
4
votes
3answers
79 views

How to disable Publishing Temporarily?

During certain periods we have the requirement to disable publishing for a period of time. The current approach for this is pretty brute-force. Delete the Publishing Targets and then restore them from ...
0
votes
3answers
76 views

Traverse to parent item that matches the given template id using Sitecore Powershell Extension

I want to find the ancestor of an item that matches the given template id using Powershell. Can anyone help me in achieving this? Scenario: I'm on Item A, I get the current item details using gi .. ...
6
votes
1answer
42 views

How to determine whether an editor is using the Desktop Content Editor or Launchpad Content Editor?

I've been doing a lot more SPE report implementations and noticed that the functionality of loading the ListView is dependent on whether the editor is using the Content Editor from Launchpad or the ...
3
votes
1answer
48 views

Determining whether item has been published

Is there an easy way using SPE to determine whether an item has been published?
3
votes
1answer
45 views

Using Show-ListView to Display a Dynamic Number of Columns in Sitecore Powershell

My goal is to use the Show-ListView function available in Sitecore Powershell to show a dynamic number of columns. I'm currently executing the Show-ListView function as follows: $table | Show-...
2
votes
1answer
37 views

Setting Presentation Aliases with Sitecore Powershell Extensions

In Sitecore 9, in the Content Editor and under the Presentation tab, there's an option to set Aliases on an item. Assuming you already have the desired item stored in variable $item, how would you set ...
0
votes
0answers
24 views

PowerShell Receive-File dialog is empty

I'm trying this really easy Receive-File but I'm getting a blanc popup. I've tried different paths but always get the same result. Another popup Read-Host is no problem. That one shows correctly. I'...
1
vote
2answers
58 views

Force saving of an item

I have several newly added save events for existing items. Any way to force a save of an item? When I do $item.Editing.BeginEdit() / $item.Editing.EndEdit() in PowerShell it returns false since ...
5
votes
2answers
72 views

Getting and setting the order of renderings/sublayouts on a page

I have written a PowerShell script that replaces sublayouts with renderings across all pages in a Sitecore site. Everything is working well except for the order of the renderings. The order always ...
0
votes
1answer
149 views

Sitecore PowerShell RemoveLinks() using Broken Links Report

I am currently using the Sitecore Powershell Broken Links Report to find and delete broken links. Using the Broken Links Report, I have been able to locate the broken links. I can't seem to delete ...
2
votes
1answer
145 views

SPE to Unlock all items locked by a specific user

Is there a quick way to unlock all the items locked by a specific user from an admin account?
1
vote
1answer
55 views

Negate the criteria filter in Sitecore Powershell Find-Item call?

I'm trying to find all items in Sitecore where a particular field ("ShortTitle") is blank. I have the following call working to Sitecore Powershell Extensions's (SPE) Find-Item, but there doesn't seem ...
5
votes
1answer
75 views

Broken Links Report Options Powershell vs. Fast Query?

I am currently trying to find and delete broken links in the Sitecore master database. I am using a version of this script. The problem I am having is that the number of items in the content tree is ...
3
votes
0answers
48 views

ShowFieldEditor on a media item detaching media

I have a simple script that we're running, where a content editor has bulk uploaded media and they want to go back through and provide attribution to the images (caption, alt text, photo credit) and ...
0
votes
1answer
35 views

New-ItemClone Error through SPE

I recently tried using New-ItemClone command on SPE and encountered this error: System.AggregateException,Cognifide.PowerShell.Commandlets.Data.Clones.NewItemCloneCommand These are the codes used: ...
7
votes
1answer
128 views

SPE How to add multiple items to package source

I'm writing a SPE script to package up all unused media library items under a specific folder (prior to deletion). I've found New-Package and New-ItemSource methods and know how to use them (to some ...
0
votes
0answers
24 views

Getting Document moved error while running remote powershell script in Sitecore 9.0 update 1 PAAS

I am trying to run Sitecore powershell script remotely using below script Import-Module -Name SPE $session = New-ScriptSession -Username $userName -Password $password -ConnectionUri $uri Invoke-...
1
vote
0answers
112 views

Sitecore Commerce 9 Update 1 Installation Issue with SPE 4.7.2

I tried to install Sitecore Commerce using PowerShell script but I got the error that resource is not found for Sitecore PowerShell Extensions 4.7.2 although I have this zip package for Sitecore 9 ...
1
vote
1answer
56 views

Type or namespace 'ProxyManager' does not exist in the namespace 'Sitecore.Data.Proxies'

I've recently downloaded the source codes for Sitecore Powershell Extensions from GitHub and I've updated the Sitecore references to use the Sitecore 9 Nuget references. After doing so, I've found ...
0
votes
2answers
53 views

Improving queries performance

I have a script that goes and queries a string from a field box. Issue: This script takes too long! How can I improve the time to get results? Set-Location master: Get-ChildItem -Path "master:\\...
2
votes
3answers
911 views

Sitecore Powershell Script to find all the items with Personalizations defined

I need to find all the items that has personalization defined on the layout definitions using a Sitecore Powershell Extensions script.
2
votes
2answers
60 views

Set accessor for property “Proxy” unavailable - Sitecore PowerShell Extensions

I have been recently started working with Sitecore and Sitecore PowerShell Extensions, but have been struggling for a while. On my local clean instance of Sitecore, I have installed the SPE package ...
8
votes
1answer
152 views

Upgrade path from Integrated Dynamic Placeholders to Sitecore 9 Dynamic Placeholders (OOTB)

Does anyone have a SPE script that could be used to upgrade the rendering parameters of existing content to the new dynamic placeholder style required for Sitecore 9 Dynamic placeholders? We used to ...
0
votes
1answer
213 views

Sitecore Powershell Script to find publish history for a particular date

Is it possible find all the items published on a given date along with Published user , published Date and time using sitecore powershell ?
2
votes
2answers
85 views

Export component list in Sitecore master db with PowerShell

I am curious to know if it is possible to export Sitecore master db using PowerShell to a csv or to PowerBI? I am exploring possibility to get information for a given UI component (e.g. “large hero”)...
2
votes
0answers
173 views

Show-ListView called from action script display columns from parent Show-ListView

We're using Sitecore PowerShell Extensions to generate some reports. We have a problem when calling "Show-ListView" from the "Actions" script that is in the parent "Show-ListView" result. Looks ...
0
votes
1answer
81 views

Getting Error 403 from Server “Forbidden” during uploading File to Sitecore

i know that my question is similar to other questions here, but i think i have a different scenario. I'm trying to upload some css files to sitecore (in my case Sc 9.0.1) by calling this url using ...
1
vote
1answer
66 views

SPE Remote Script Call Nullreference Exception

Situation I'm trying to use the SPE Web API to call a simple script to publish 1 single item from gulp (in SXA Theme). The script URL call looks like this: /-/script/v2/master/PublishItem?user=...
0
votes
1answer
68 views

Bulkupdate change language for source folder

I am running power shell script to bind treelist data in both language english & french.even if i change language am getting only English content in french .please review my script and let me know ...
0
votes
2answers
79 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
434 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
0answers
238 views

SXA Import Failed Value cannot be null. Parameter name: source

I am using Sitecore 9.0 Updated 1 and Install Sitecore Experience Accelerator 1.6 rev. 180103 in my Sitecore instance. Now Working in SXA we have created dummy site and Export the site to add one new ...
0
votes
1answer
190 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
608 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 ...
0
votes
0answers
69 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"; ...
1
vote
0answers
105 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
0answers
130 views

Create an item at site creation with Sitecore PowerShell

I wrote a simple script in order to push an item when i create a new site: $item = New-Item -Path $SitecoreContextItem.Paths.Path -Name "bidule" -ItemType "/sitecore/templates/Project/OSK/OSK Home" ...
0
votes
1answer
93 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
146 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 ?