SSRS Powershell Deploy
PowerShell module to publish SQL Server Reporting Services project(s)
(.rptproj
) to a Reporting Server
Chat
Wiki
There's a project wiki on github, go ahead and expand it
This fork
This repository was forked from:
- https://gist.github.com/Jonesie/9005796
- which was forked from https://gist.github.com/ChrisMissal/5979564
- which was forked from https://gist.github.com/jstangroome/3043878
- which was forked from https://gist.github.com/ChrisMissal/5979564
I've turned it into a proper github repo to allow discussion, pull requests etc.
Installation
PowerShell Gallery
Install the SSRS module from PowerShell Gallery:
Make sure you have PowerShell Gallery installed (instructions on their homepage). It's already available in Windows 10.
In an elevated powershell console run:
Install-Module -Name SSRS
Say y
to installing from untrusted. Then close the elevated console and you
will now have the Publish-SSRSProject
/Solution
commands available in all
your powershell sessions.
If you can't use the gallery for some reason then you can do a manual install from a download:
Manual install
- Download the .zip from https://github.com/timabell/ssrs-powershell-deploy/releases/latest
- Right-click the zip file in windows explorer, click "properties", and then click "Unblock".
- Create folder
Documents\WindowsPowerShell\Modules\
- Open up the zip file, copy the SSRS folder, paste it into
Documents\WindowsPowerShell\Modules\
. (Or somewhere on your$env:PSModulePath
)
Usage
Publish-SSRSProject.ps1 -path YourReportsProject.rptproj -configuration Release -verbose
You can either specifiy a build configuration to read from the project file, or you can specify all the information required to publish in the rest of the parameters.
Publish-SSRSProject [-Path] <string> [[-Configuration]
<string>] [[-ServerUrl] <string>] [[-Folder] <string>]
[[-DataSourceFolder] <string>] [[-DataSetFolder] <string>]
[[-OutputPath] <string>] [[-OverwriteDataSources] <bool>]
[[-OverwriteDatasets] <bool>] [[-Credential] <pscredential>]
[<CommonParameters>]
Example reports
To open the Example-Reports project in Visual Studio you'll need Sql Server Data Tools (SSDT)
General SSRS gotchas
Disappearing dataset panel - http://stackoverflow.com/questions/7960824/i-lost-datasets-pane-in-visual-studio/28883272#28883272
VS report projects cache both datasets and data. Remove all the .data
files and the
bin/
folder(s) to be sure your changes will work when published.
http://stackoverflow.com/questions/3424928/in-ssrs-is-there-a-way-to-disable-the-rdl-data-file-creation
More SSRS love http://timwise.blogspot.co.uk/2015/08/100-reasons-i-hate-ssrs.html <3 <3
Development
Developed with PowerShell Tools for Visual Studio 2015
To test the module locally directly from the source tree you can import by specifiying the path to the psd1 file.
PS C:\repo\ReportDefinitions> Import-Module C:\repo\tim\ssrs-powershell-deploy\ssrs-powershell-deploy\SSRS\SSRS.psd1
PS C:\repo\ReportDefinitions> Publish-SSRSProject
See the exported commands with
PS C:\repo\ReportDefinitions> Get-Command -Module SSRS
CommandType Name Version Source
----------- ---- ------- ------
Function Publish-SSRSProject 1.2.0 SSRS
Function Publish-SSRSSolution 1.2.0 SSRS
Unload again with
PS C:\repo\ReportDefinitions> Remove-Module SSRS