Skip to main content

Posts

Showing posts from March, 2022

Sitecore Powershell Script to Update Datasource Path In Final Rendering

Sitecore Powershell Script to Update Datasource Path In Final Rendering  In project, there was a requirement to update datasource for specific rendering so to update the rendering datasource I wrote below PowerShell script.   Function Change-RenderingDatasourceInAllPages{ Param( [Parameter(Mandatory=$true)] [String]$PagesRoot, [Parameter(Mandatory=$true)] [String]$Placeholder, [Parameter(Mandatory=$true)] [String]$DataSourcePath, [Parameter(Mandatory=$true)] [String]$ItemId ) $pages = @(get-item $PagesRoot) $pages += @(get-childitem -Path $PagesRoot -Recurse) $defaultLayout = Get-LayoutDevice "Default" foreach($page in $pages) { Get-Rendering -Item $page -Device $defaultLayout -FinalLayout -Placeholder $Placeholder | ForEach { if($_.ItemID -eq $ItemId) { $_.Datasource=$DataSourcePath Set-Rendering -Item $page -Instance $_ -FinalLayout:$True

Sitecore 10.2 ERROR: Container is unhealthy

 Error: Sitecore 10.2 ERROR: Container is unhealthy Solution: I resolved this issue by using below steps: Run docker-compose stop on Powershell. Run docker-compose down on Powershell. Run iisreset /stop on Powershell. Then run docker-compose up -d on Powershell.

Sitecore 10.2 Installation Error : "Error response from daemon: Unrecognised volume spec: file '\\.\pipe\docker_engine' cannot be mapped. Only directories can be mapped on this platform"

Error:  Sitecore 10.2 Installation Error: "Error response from daemon: Unrecognised volume spec: file '\\.\pipe\docker_engine' cannot be mapped. Only directories can be mapped on this platform" with Docker Solution: I have resolved this issue by turning off the option in Docker Desktop settings or use the CLI command docker-compose disable-v2 . This error usually comes when using Docker Compose V2