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
19 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
163 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
27 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
27 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 ...
4
votes
2answers
212 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\...
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 ...
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....
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....
-4
votes
2answers
234 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
2answers
73 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 ...
4
votes
3answers
80 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
1answer
152 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 ...
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 ...
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=...
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 ...
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?
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 ...
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
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
129 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 ...
2
votes
3answers
913 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.
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 ...
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
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
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 ...
5
votes
1answer
289 views

Unable to get value of $_.Source using SPE

I have a rich text field in my user defined template and I want to replace the source value of the rich text field. Below is my query where I'm able to read Name, type etc, however $_.source is ...
3
votes
1answer
553 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 ...
3
votes
2answers
468 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.
10
votes
1answer
510 views

Update all users in the Administrator Role

I want to be able to update all users who have the Administrator checkbox selected without manually going through each of the user. In the same script I would like to add them to another Role. This ...
9
votes
2answers
637 views

How to pass arguments to SPE's Invoke-RemoteScript

I want to pass some arguments to a script block that will be run on a remote Sitecore instance via SPE remoting. I wrote this script as a test, but it's not working. $session = New-ScriptSession -...
11
votes
2answers
321 views

Can you run Sitecore Powershell without triggering Sitecore events?

I want to write a script which could potentially clean up a load of unused assets, but I would like it not to trigger events (index rebuilds etc). Is there a way to say "do this silently" in a ...
3
votes
1answer
421 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 ...
1
vote
1answer
443 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 ...
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
174 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 ...
0
votes
1answer
69 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 ...