Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Madhu-Anbalagan/1f9141fa9fa12643d7c548b7179aa5f2 to your computer and use it in GitHub Desktop.
Save Madhu-Anbalagan/1f9141fa9fa12643d7c548b7179aa5f2 to your computer and use it in GitHub Desktop.
Sitecore Media Library Items Export to CSV Using Sitecore Powershell Extensions
$everythingUnderMediaLibrary = Get-Item master: -Query "/sitecore/media library//*"
$outputFilePath = "C:\Media_Library_Export.csv" #Create an empty csv file and paste the path here
$results = @();
$everythingUnderMediaLibrary | ForEach-Object {
$properties = @{
ItemID = $_.ID
Name = "$($_.Name)"
ItemPath = "$($_.ItemPath)"
Extension = "$($_.Extension)"
Title = $_.Title
Alt_text = $_.Alt
Template = $_.TemplateName
}
$results += New-Object psobject -Property $properties
}
$Results | Select-Object ItemID,Name,ItemPath,Extension,Title,Alt_text,Template | Export-Csv -notypeinformation -Path $outputFilePath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment