New answers tagged

3

Using the OOTB powershell scripted task schedule, you will not be able to pass the parameters from the Tasks item itself. However, there are 2 possible solutions. 1st Solution You can create a new folder that will host the parameters you want your script to have. From your PowerShell script, you will read that particular folder and then use the value stored ...


0

I have updated your Sitecore PowerShell Script as shown below $path = "/sitecore/A/B/Home/Topics/Video"; $presentTime = [datetime]::Now; $video = "video"; Write-Host $presentTime; $items = Get-ChildItem -Path "master:" $path -Language 'en' -recurse Write-Host $items; foreach ($item in $items) { #$selectedItem = ...


1

Check the following script: $sourceContainer = "/sitecore/content/Home/from"; $destinationContainer = "/sitecore/content/Home/to"; function ProcessItem { param ( [Sitecore.Data.Items.Item]$item ) if((Get-Item -Path ($item.Paths.FullPath -replace $sourceContainer, $destinationContainer) -ErrorAction SilentlyContinue)) {...


2

You text contains multiple lines, but it doesn't matter when html is being rendered. What you need to do is either wrap every single line into a separate paragraph (<p>) or replace new lines with <br> tags. Here is sample code for the latter: $item["Description"] = ($row.'Description' -replace "`r`n", '<br>') -replace &...


0

Michael West's answer of using SPE Content Migrator in conjunction with SPE Remoting, instead of Sidekick's Content Migrator, worked a charm.


2

1. Using PSCustomObject in array $list = [System.Collections.ArrayList]@() in for each loop assign value to info object and then add it to list $info = [PSCustomObject]@{ "data1"="test 1" "data2" = "test data 2" } [void]...


Top 50 recent answers are included