I need to select items from Sitecore and write the output to an excel file, using PowerShell.
I am able to do that, but I need to change the field names while writing to the Excel file.
For instance, in Sitecore the item has fields: Name
, ProviderPath
In Excel, they should be written as FileName
, FilePath
Here is my code:
Import-Function -Name ConvertTo-Xlsx
$mediaItemContainer = Get-Item -Path "master:/sitecore/media library/Project/MyProject/MyImages"
[byte[]]$items = $mediaItemContainer.Axes.GetDescendants() |
Select-Object -Property Name, ProviderPath |
ConvertTo-Xlsx
Out-Download -Name "images.xlsx" -InputObject $items