Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Define the folder containing the RDL files
- $rdlFolder = "C:\Path\To\RDLFiles"
- # Loop through all RDL files in the folder
- Get-ChildItem -Path $rdlFolder -Filter *.rdl | ForEach-Object {
- $rdlFile = $_.FullName
- Write-Host "`nProcessing: $($_.Name)" -ForegroundColor Cyan
- try {
- # Load the XML content
- [xml]$xml = Get-Content $rdlFile
- # Extract metadata
- $reportName = $_.BaseName
- $description = $xml.Report.Description
- $dataSources = $xml.Report.DataSources.DataSource.Name
- $datasets = $xml.Report.DataSets.DataSet.Name
- $parameters = $xml.Report.ReportParameters.ReportParameter | ForEach-Object { $_.Name }
- # Display extracted metadata
- Write-Host "Report Name : $reportName"
- Write-Host "Description : $description"
- Write-Host "Data Sources : $($dataSources -join ', ')"
- Write-Host "Datasets : $($datasets -join ', ')"
- Write-Host "Report Parameters: $($parameters -join ', ')"
- }
- catch {
- Write-Host "Failed to parse $rdlFile" -ForegroundColor Red
- Write-Host $_.Exception.Message
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement