Skip to content

Instantly share code, notes, and snippets.

@SQLvariant
Created February 13, 2017 18:43
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SQLvariant/6cc6d15320d2a877a946b83b873be1b2 to your computer and use it in GitHub Desktop.
Save SQLvariant/6cc6d15320d2a877a946b83b873be1b2 to your computer and use it in GitHub Desktop.
Code Samples for PowerShell Commands for SQL Server Reporting Services Are Here - Article
<#1#>
Install-Module -Name ReportingServicesTools
Invoke-Expression (Invoke-WebRequest https://aka.ms/rstools)
<#2#>
Get-Command -Module ReportingServicesTools
<#3#>
https://github.com/Microsoft/tigertoolbox/raw/master/SQL-performance-dashboard-reports/SQL%20Server%20Performance%20Dashboard%20Reporting%20Solution.zip
Get-Help -Full Write-RsFolderContent
<#4#>
New-RsFolder -ReportServerUri http://localhost/ReportServer -Path / -Name MSSQLTips -Verbose
<#5#>
Write-RsFolderContent -ReportServerUri http://localhost/ReportServer -Path "C:\MSSQLTips\SQL Server Performance Dashboard\" -Destination /MSSQLTips -Verbose
<#6#>
Write-RsCatalogItem -ReportServerUri http://localhost/ReportServer -Path "C:\MSSQLTips\SQL Server Performance Dashboard\performance_dashboard_main.rdl" -Destination / -Verbose
<#7#>
Remove-RsCatalogItem -ReportServerUri http://localhost/ReportServer -Path /performance_dashboard_main -Verbose
<#8#>
Dir 'C:\MSSQLTips\SQL Server Performance Dashboard\' |
Out-GridView -PassThru |
Write-RsCatalogItem -ReportServerUri http://localhost/ReportServer -Destination /MSSQLTips -OverWrite -Verbose
<#9#>
$Reports = 'C:\MSSQLTips\SQL Server Performance Dashboard\historical_io.rdl', 'C:\MSSQLTips\SQL Server Performance Dashboard\historical_waits.rdl'
Write-RsCatalogItem -ReportServerUri http://localhost/ReportServer -Path $Reports -Destination / -OverWrite -Verbose
<#10#>
Dir 'C:\MSSQLTips\SQL Server Performance Dashboard\' -Filter wait*.Rdl |
Write-RsCatalogItem -ReportServerUri http://localhost/ReportServer -Destination /MSSQLTips -OverWrite -Verbose
<#11#>
Dir 'C:\MSSQLTips\SQL Server Performance Dashboard\' -Filter *.Rdl |
WHERE LastWriteTime -GT 2017-01-01 |
Write-RsCatalogItem -ReportServerUri http://localhost/ReportServer -Destination /MSSQLTips -OverWrite -Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment