Created
August 27, 2022 04:11
-
-
Save Madhu-Anbalagan/1f9141fa9fa12643d7c548b7179aa5f2 to your computer and use it in GitHub Desktop.
Sitecore Media Library Items Export to CSV Using Sitecore Powershell Extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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