Open PavelSamoilenko opened 5 years ago
Hi,
I experienced the same problem. Seems like the dotted notation is unreliable.
When using selectNodes it is working, also when only one DataSet/Report. However it only works when the schema xmlns attribute is not referenced in the
$ns = New-Object System.Xml.XmlNamespaceManager($Project.NameTable)
$ns.AddNamespace("msbld", $Project.DocumentElement.NamespaceURI)
$DataSourcePaths = @{}
$Project.SelectNodes("//msbld:DataSource", $ns) |
ForEach-Object {
$RdsPath = $ProjectRoot | Join-Path -ChildPath $_.Include
$DataSource = New-SSRSDataSource -Proxy $Proxy -RdsPath $RdsPath -Folder $DataSourceFolder -Overwrite $OverwriteDataSources
$DataSourcePaths.Add($DataSource.Name, $DataSource.Path)
}
@vminds I tried your solution and it works fine for the DataSources. Would be cool if you could come up with a PR that includes the Report.Count path as well.
I did add some more features such as removing datasource/reports using the Microsoft/ReportingServicesTools. Need to finalize and generalize the code and plan to add it as a fork of this repo.
Who faced to with the same limitations.
Error in PowerShell if only one item in XML (one report or one DataSource): Publish-SSRSProject : The property 'Count' cannot be found on this object. Verify that the property exists
Error, if there are not DataSources in the rpproj file: Publish-SSRSProject : The property 'DataSource' cannot be found on this object. Verify that the property exists.
You should add at least two items for every node:
Via Visual Studio:
Error here: (before merge https://github.com/timabell/ssrs-powershell-deploy/pull/25)
Would be grate if anybody remove these limitations.