tobania / VSTS.Extension.SqlReportingServices

VSTS Extension for uploading SSRS Reports
MIT License
14 stars 20 forks source link

Add feature allowing creation of missing folders on the target. #30

Open dancaswell opened 6 years ago

anton-kirschhock commented 6 years ago

I will do this next week (got a week off)

mjcarrabine commented 6 years ago

Thanks @dancaswell and @muziekklas, this is a very useful feature.

Issue

The first call to Create-MissingFolders below works as expected. However, the second call to Create-MissingFolders does not create any folders because it is finding the folder with name RegionA that now exists under /Data Sources and then not creating one at /.

$DataSourceRootPath = "/Data Sources/RegionA/Data Sources"
$ReportUploadRootPath = "/RegionA/Sales"
Create-MissingFolders $DataSourceRootPath
Create-MissingFolders $ReportUploadRootPath 

Possible solution

Setting recursive to $false on ListChildren by changing from

$ssrs.ListChildren($rootFolder, $true)

to

$ssrs.ListChildren($rootFolder, $false)

resolved this issue in my situation.