Questions tagged [powershell-extensions]
Anything related to the Sitecore PowerShell Extensions (SPE) module
513 questions
0
votes
1
answer
18
views
SPE Remote scripting - Receive-RemoteItem Error: Download failed. Internal Server Error
We had this issue when trying to use SPE Remote Scripting but the file test-1.0.zip definitely existed:
Connecting to Sitecore instance...
Package created at: /temp/test-1.0.zip
VERBOSE: Preparing ...
0
votes
0
answers
40
views
How to refresh an item using SPE
I have created a Sitecore chunk using SPE to delete multiple items. After deleting the items, I have to refresh the tree manually. I want to know if there is any way to refresh the item's parent using ...
1
vote
4
answers
70
views
open treelist left pane using sitecore SPE dialog
my code is below. I want to open left pane of tree list with context item. it is not happening. Can anyone please help. I have pasted my code below.
$selectedItems = get-item .
$dialogProps1 = ...
2
votes
3
answers
97
views
Sitecore PowerShell Add-ItemLanguage Fails Silently for Some Items, Even in a Sterile Context
I am experiencing a persistent, silent failure when using Sitecore PowerShell Extensions (SPE) to create new language versions for a specific set of items.
The Goal: To programmatically create a new ...
3
votes
1
answer
57
views
Calling RemoteScriptCall.ashx to run a Publish-Item without success
I have a Windows service that needs to send and publish Items in Sitecore. This service is in .NET Core, so the best solution I've found is to remotely call Sitecore's PowerShell through "SPE ...
1
vote
0
answers
35
views
Malformed CSV file under certain conditions
I have a report that pulls things like template name, path, ID and age of items. Note none of these fields should have line breaks.
The report wouldn't work in Show-Listview - it would say "...
2
votes
1
answer
74
views
How to change or migrate language code in Sitecore (e.g. from pt-BR to pt-LA)?
I’m working on a Sitecore XP 10.0.1 implementation where we currently have content created under the language pt-BR.
Due to localization requirements, we need to fully switch to a new language code: ...
0
votes
3
answers
102
views
How do I download all the Sitecore log files when grouped into folders?
Our configuration allows the log.*.txt files to all appear in the root directory of /App_Data/logs while everything else appears in a folder.
The primary issue now is that the Log Viewer does not ...
0
votes
2
answers
177
views
How to move renderings from Final to Shared layout in Sitecore using PowerShell?
I need to transfer not full layout only some common renderings from the Final layout to the Shared layout in the presentation details section for over 100 pages in Sitecore 10.2.
I've attempted to ...
1
vote
2
answers
254
views
Scheduled Task not running when it should only run once in a week
I have a scheduled task for sending weekly reports. The task is created in Sitecore and set to run on Fridays. I have added this 1900101|20990101|32|168:00:00 in the schedule field. It is running ...
2
votes
2
answers
92
views
List of all items updated within the last 24 hours include who changed them and the path of each item in Sitecore with PowerShell
I am working on Sitecore with PowerShell and have a requirement to create a list of all items updated within the last 24 hours. I need to include who changed them and the path of each item in Sitecore....
1
vote
2
answers
118
views
How to get the component list by Powershell in sitecore
Need to get list of most used components to ensure that they work with (Landing Page) specific template.
1
vote
2
answers
131
views
How to get Ancestors of an item using sitecore powershell
I would like to know how to get Ancestors of an item using powershell.
Thanks,
Sai
1
vote
3
answers
166
views
How to add language version for children of an item in Sitecore using PowerShell
I have tried both Add-ItemVersion and Add-ItemLanguage. Both are not working. I do nt see the versions created. can anyone please help
$copiedChildren | Add-ItemVersion -TargetLanguage "cs-cz&...
0
votes
0
answers
59
views
Powershell reports button Launchpad
We are currently on Sitecore 10.3 XM and want getting the reports displayed as we click Powershell Reports button in the Launch pad. Currently it displays below message. Can someone please help us in ...
0
votes
1
answer
40
views
How do you pass variables to the Read-Variable validator scriptblock?
So far my dialog provides a simple text field with validation. I would like to pass a variable from outside the scope of the validator scriptblock.
$scriptVariable = "this is a script variable&...
0
votes
1
answer
59
views
Sitecore Powershell Layout Delta
I'm trying to figure out how to obtain the delta between the Shared Layout and Final Layout. I have a component in the Shared Layout, but not in the Final Layout, but it is still not showing on the ...
0
votes
0
answers
63
views
Sitecore PowerShell script to copy languages and override language fallback
To copy/create languages in Sitecore PSE is very easy to do:
Add-ItemLanguage $_ -Language $originLanguage -TargetLanguage $destinationLanguages -IfExist $ifExists
If a language fallback is enabled ...
0
votes
0
answers
59
views
sitecore powershell api Get-item
$itemPath = "master:/sitecore/media library/sample/sampleConfig"
$itemPath = Get-Item -Path $itemPath -Language "ja-JP"
I am running a script like the one above.
I get a not exist ...
0
votes
2
answers
174
views
Update Datasource Item Path in Item Presentation Details using PowerShell in Sitecore
I need to update the Datasource Item Path in Item Presentation Details using PowerShell for Sitecore.
Since there are over 100 items, I want to avoid doing this manually. I've written a PowerShell ...
1
vote
0
answers
38
views
PowerShell Persistent session not working
I needed to execute a script that should send an email whenever AppPool Recycle event occurs in the server - came with below script that check whether AppPool recycled in every 10 minutes.
$startTime =...
4
votes
5
answers
404
views
How to get all the templates by Powershell in sitecore
I need help to Pull a list of all templates within Sitecore including
Template Name
Number of pages using this template
URL of page using the template
1
vote
1
answer
54
views
How do you search for all results using pagination?
I found that the default setting for search results was far too many for our website so I reduced the maximum results to 250 using the following patch:
<setting name="ContentSearch....
4
votes
4
answers
381
views
How to create item in Sitecore with multiple languages using single PowerShell script
I'm creating multiple item in multiple language in Sitecore using PowerShell Script I'm using 2 script for different different language is this possible in single script. Adding here both script.
...
3
votes
2
answers
199
views
Sidekick PowerShell - Couldn't import module
I'm trying import the Sidekick Powershell module, Sitecore says it can't open the file.
I gave full permission to the folder for
IIS-URUS
AppPool/local-cm
IUSR
However, I'm still not having any luck....
1
vote
3
answers
83
views
SPE remote script output is not provided in real time
When I execute this script in Sitecore Powershell ISE:
Write-Host 'This is a test'
$count = 0
$customObj = [PsCustomObject]@{
Ask = 'Hello'
Jeeves = 'World'
Count = $count
}
$customObj
...
0
votes
2
answers
265
views
How to Check the string format in Sitecore Powershell?
I have two videos format first one only dashes and second one underscores and dashes. I need figure out format by Sitecore powershell script from specific path.
Format One Video Images (dashes):
video-...
1
vote
2
answers
224
views
how to update some field value in sitecore using powershell? [duplicate]
I have got following script,
$newsPath = "/sitecore/content/XA/xa-website/home/News"
[Sitecore.Data.ID] $templateId = "{2A4C30D0-A53C-494F-AADF-3790828CDDFE}"
$news = Find-Item -...
2
votes
4
answers
155
views
How to Retrieve Template IDs from a Folder Containing Image or File Field Types
This is my PowerShell script, where templateFolderPath is a path of my template folder:
$templateFolderPath = "/sitecore/templates"
$templateIds = @()
$templateFolderItem = Get-Item -...
3
votes
1
answer
176
views
Sitecore PowerShell Show-ListView not displaying text enclosed in < >
I am trying to get the raw values of fields of multiple items and display the result using Show-ListView. However, the result is not showing the values when it is enclosed in < > which can be ...
4
votes
3
answers
465
views
How to update the checkbox field value in Sitecore Powershell Extensions?
I'm using the PowerShell script to update a specific field of the item in the content tree. It works for singleline, richtext, link fields but the update is not applied to the checkbox field. How to ...
3
votes
3
answers
1k
views
How to get Sitecore item fields from item using powershell?
I am trying to get all the fields on the available item. seems like the following line is not fetching all the fields. Am i missing something ?
$fields = $item.Fields
0
votes
1
answer
140
views
How to enable data source item versions, when user click on Lock and edit options
I'm implementing the workflow setup in sitecore 10.2 version and the page has datasource items present. If the user clicks on Lock and edit options, then a new version will be created for page and ...
0
votes
1
answer
156
views
Why is SPE Remote not using the credentials provided?
I am trying to use Sitecore Remote Powershell following the guide here.
No errors are immediately returned, however, looking in the SPE logs I can see the following logs:
8132 10:43:17 INFO A request ...
5
votes
3
answers
326
views
How to tell if the item language is the fallback language or the regular language version
How to tell if the item language is the fallback language or the regular language version using a PowerShell script
0
votes
2
answers
192
views
Acess Sitecore content editor ribbon item via sitecore powershell extension
How do I access Sitecore content editor's ribbon button using Sitecore PowerShell extension?
I need to use this validation button for all the items created and have a look at the errors (if any). Is ...
1
vote
2
answers
125
views
How to perform rebuild link database from outside of sitecore server on a remote desktop
There is a way to rebuild the link database in Sitecore using the Control Panel available on Content Management. We are trying to automate this process of rebuilding the link database.
Now, I want to ...
1
vote
2
answers
125
views
Is there a way to look at versions tied to an item in recycle bin or archive?
Doing a lot of cleanup of versions and generating several reports. We are cleaning up versions on tons of items and I wanted to generate a report of the completed activity. I can get the item ...
1
vote
1
answer
142
views
How to open up specific PowerShell script in PowerShell ISE via URL
I want to be able to share links that automatically open a script in the PowerShell ISE. For now, my workaround is to share a link directly to the saved script item in the Content Editor using the fo ...
1
vote
2
answers
115
views
SPE 6.4 Getting the Context Item
I'm working on a SPE script to execute when a workflow state is hit.
I've been trying to get the context item in the script, using the command Get-Item . (as I understand it, this should get the ...
3
votes
1
answer
230
views
Can I get a list of items stored in items-as-resources using SPE?
I'm defining serialization, and I'd like a report of items loaded by Sitecore so I can make sure I'm avoiding those paths. Is it possible to get a CSV listing of all items in the stock items-as-...
0
votes
1
answer
81
views
Invoke Sitecore service provider from SPE console
Is it possible to interact with Sitecore's DI container from the SPE command line? I was able to do this:
PS master:\>[Sitecore.DependencyInjection.ServiceLocator]::IsConfigured
True
But when I ...
1
vote
2
answers
108
views
Download media content using powershell [closed]
I have a csv file where in path C:\Usman\meetings_export.csv and has a column called media-ID. This column has media ids which are comma separated,
for example: {5625AF3F-F69C-420A-AFE3-B19060F42A43},{...
2
votes
4
answers
1k
views
How to return specific HTTP response code from script that called via Powershell Web API
There is some Power Shell script that returns content.
and it is called using the Powershell Web API:
Invoke-WebRequest -Headers $headers -Uri $CMHostname/-/script/v2/master/Get-TestContent?type=...
1
vote
2
answers
329
views
In Sitecore powershell how we can check that an item is publishable or not where by traversing all its parent
In our project we are creating static sitemap and need to exclude not publishable item from master sitemap. We need a way to find this detail at item level or do we need custom code to do that.
2
votes
2
answers
230
views
Broken error message within PowerShell Receive-File dialog. Sitecore XP 10.1.2 (rev. 006578)
I have a simple powershell script that invokes file upload into the context item:
Receive-File -ParentItem (get-item .)
If I try to upload existing file (name of the item exists in the same folder) it ...
2
votes
3
answers
144
views
Find items who content have 404 links
I'm running a script in which I'm trying to get the item whose content has broken links, (links that redirect the user to a page with 404 as response). But I always get the same result, no broken ...
0
votes
5
answers
823
views
Sitecore PowerShell script to convert Sitecore Date field data to other format
I am having Sitecore's Date field data coming as 20230804T000000Z, I also have time coming as 11 am. The Date is coming from Sitecore date field, and time from Single-Line Text field as below.
I need ...
0
votes
3
answers
510
views
Powershell script to download media library content to my machine
I have Sitecore 8.2 where I got spe version 6.4
I have got a csv file, where sample of data i.e. one row looks as
"Item ID","Title","Created","Changed","...
0
votes
2
answers
116
views
Using Find-Item to get equivalent result of Get-Item
I have got
$eventsPath = "/sitecore/content/Global Content/Events"
$templateId = "{EBE88C21-4035-4266-9647-B4C88F1BC000}"
# Function to get data and print on the screen
function ...