Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon

Deploy SSRS Projects with Two New PowerShell Commands from Blog Posts - SQLServerCentral

Save for later
  • 3 min read
  • 11 Nov 2020

article-image

I built two new PowerShell commands to deploy SSRS projects, and they have finally been merged into the ReportingServicesTools module. The commands are Get-RsDeploymentConfig & Publish-RsProject. While the Write-RsFolderContent command did already exist, and is very useful, it does not support deploying the objects in your SSRS Project to multiple different folders in your report server. These two new commands can handle deployment to multiple folders.

The concept is fairly simple, first you run the Get-RsDeploymentConfig
command to pull in all the deployment-target details from the SSRS project file. In SSRS projects you can have multiple deployment configurations, so you can specify which configuration you want to use by supplying the name of that configuration for the
-ConfigurationToUse parameter. This will give you back a PSObject with all the info it collected.

deploy-ssrs-projects-with-two-new-powershell-commands-from-blog-posts-sqlservercentral-img-0

After that, you need to add the URL of the report portal manually (unfortunately, these are not included in the SSRS Project config files).

You can put all of that together and see the results like this:

$RSConfig = Get-RsDeploymentConfig RsProjectFile C:sourcereposFinancial ReportsSSRS_FRSSRS_FR.rptproj ConfigurationToUse Dev01 $RSConfig | Add-Member PassThru MemberType NoteProperty Name ReportPortal Value http://localhost/PBIRSportal/

$RSConfig

Once that looks good to you, all you have to do is pipe that object to the Publish-RsProject command, and your deployment should start.

$RSConfig | Publish-RsProject

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at $19.99/month. Cancel anytime

Some quick notes:

  • Obviously, the account running these commands will need a copy of the SSRS project it can point to, as well as the necessary credentials to deploy to the SSRS/PRIRS server you point it to.
  • For the Get-RsDeploymentConfig command, the SSRS project you are using must be in the VS 2019 project format. Otherwise, the command won’t know where to look for the correct info.
  • If you don’t know the name of the configuration you want to use, just point Get-RsDeploymentConfig to the project file, and it will give you back a list of configuration options to choose from.
  • Make sure you run Update-Module ReportingServicesTools
    to get these new commands.

FYI: I only had two SSRS projects available to test these commands with. They worked great for those two projects, but your SSRS project might include some complexities that I just didn’t have in either of the projects I tested with. If you have any trouble making this work, please give me a shout or file a bug on the GitHub project and I will try to help out.

Big thanks to Doug Finke ( t ) for his code contributions, and Mike Lawell ( t ) for his help testing, to make these two commands a reality.

The post Deploy SSRS Projects with Two New PowerShell Commands first appeared on SQLvariations: SQL Server, a little PowerShell, maybe some Power BI.

deploy-ssrs-projects-with-two-new-powershell-commands-from-blog-posts-sqlservercentral-img-1

The post Deploy SSRS Projects with Two New PowerShell Commands appeared first on SQLServerCentral.