I am trying to generate report using powershell. I am getting results but when I tried to download report using powershell report dialog box throwing error as shown in below screenshot
Please see below code that I wrote to generate report, my Sitecore version is Sitecore 9 update 2 and powershell version is 4.7.2
$startPath = "master:/sitecore/content/Home"
Write-Host "Search started $(Get-Date -format 'u')"
$linkProvider = [LM.Lightcore.Links.LinkProvider]::new()
$urlOptions = [Sitecore.Links.UrlOptions]::new();
$list = [System.Collections.ArrayList]@()
$itemsToProcess = Get-ChildItem $startPath -Language * -Recurse
if($itemsToProcess -ne $null) {
$itemsToProcess | ForEach-Object {
$match = 0;
foreach($field in $_.Fields) {
if($field -match '.*__SearchText*') {
$item = Get-Item ("web:" + $_.ID)
$info = [pscustomobject]@{
"FullPath"=$_.Paths.FullPath
"ItemUrl"=$linkProvider.GetItemUrl($item, $urlOptions)
}
[void]$list.Add($info)
}
}
}
}
Write-Host "Search ended $(Get-Date -format 'u')"
Write-Host "Items found: $($list.Count)"
$list | Show-ListView
Close-Window
Thanks Rishi