microsoft / ReportingServicesTools

Reporting Services Powershell Tools
MIT License
458 stars 213 forks source link

If Report has more than 1 subscription Copy-RsSubscription targets the Source report after the 1st Subscription is copied #420

Open HSTAndrewMcKenna opened 9 months ago

HSTAndrewMcKenna commented 9 months ago

Do you want to request a feature or report a bug? BUG

What is the current behavior? If Report has more than 1 subscription, the Copy-RsSubscription function targets the Source report after the 1st Subscription is copied. I used the Get-RsSubscription piped into Copy-RsSubscription.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Command used Get-RsSubscription -ReportServerUri 'http://SSRSHOST//ReportServer' -RsItem '/XXXX Reports/CT6001 - Transaction Codes_XXXX_2' | Copy-RsSubscription -ReportServerUri 'http://SSRSHOST//ReportServer' -RsItem '/XXXX Reports/CT6001 - Transaction Codes_XXXX_3'

Results NewSubscriptionId DestinationReport OriginalReport


e5710850-f8f2-40d7-9d7c-367ec79660c5 /XXXX Reports/ME9002 - Payer AR Aging_XXXX_3 /HST Reports/ME9002 - Payer AR Aging_XXXX_2 bff7e1c3-17f6-4d12-b750-b0c0e931108d /XXXX Reports/ME9002 - Payer AR Aging_XXXX_2 /HST Reports/ME9002 - Payer AR Aging_XXXX_2 3c6f48b2-289b-4815-b5e0-218ff120aba3 /XXXX Reports/ME9002 - Payer AR Aging_XXXX_2 /HST Reports/ME9002 - Payer AR Aging_XXXX_2 c9658691-410f-43d4-8b1b-dba1ccfe312d /XXXX Reports/ME9002 - Payer AR Aging_XXXX_2 /HST Reports/ME9002 - Payer AR Aging_XXXX_2

What is the expected behavior? I expect that all Subscription items piped to the Copy-RsSubscription will all end up at the specified TARGET report specified by the rsItem parameter.

I was able to work around it by putting the subscriptions in a collection and Enumertaing that via foreach-object, then piping the indivisual subscription item into the Copy-RsSubscription commandlet.

Which versions of Powershell and which OS are affected by this issue? Did this work in previous versions of our scripts? Name Value


PSVersion 5.1.17763.5328
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.5328
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

PS ....> Get-Module -Name ReportingServicesTools

ModuleType Version Name ExportedCommands


Script 0.0.6.6 ReportingServicesTools {Backup-RsEncryptionKey, Connect-RsReportServer, Copy-RsSubscription, Export-RsSubscriptionXml...}

First time using these scripts.