Home Gitesh Portfolio Blog About Me Gallery Contact

Sitecore: Powershell script to export results in Excel

Import-Function -Name ConvertTo-Xlsx

[byte[]]$myPages = Get-ChildItem -Path "/sitecore/content/Home" -Recurse |  
Where-Object { $_.TemplateID -match "{xxxxxxxx-xxxx-xxxx}" } |  
Select-Object -Property Name, Id, TemplateName, ProviderPath, "Meta Robots" |  
ConvertTo-Xlsx

Out-Download -Name "report-$datetime.xlsx" -InputObject $myPages
 
Posted: 29/01/2025 12:22:42 a.m. by Gitesh Shah | with 0 comments