When trying to reuse New-RsFolder command it will throw an exception when trying to recreate it. This makes the script use it unable to be truly idempotent or be able to run it again without issue.
How to test this code:
Make sure SSRS is installed and initialized
Run as Admin in powershell
Import the module
Run this twice: New-RsFolder -RsFolder '/' -FolderName MyReports -ReportServerUri 'http://localhost/reportserver'
Expected: Folder should be created at first and the second time run does nothing
Has been tested on (remove any that don't apply):
Powershell 5 - Windows Server 2022
SQL Server 2019 Reporting Services Version 15.0.8434.2956
Changes proposed in this pull request:
How to test this code:
New-RsFolder -RsFolder '/' -FolderName MyReports -ReportServerUri 'http://localhost/reportserver'
Has been tested on (remove any that don't apply):