Forum Discussion
Update Shared Datasouce for Report using PowerShell
I'm stuck at the exact same place. So baffled. Did you ever get this to work? Thanks!
If you want to point to a different shared data source you need to use the Set-RsDataSourceReference cmdlet
- erico6 years agoNew Member
Hi d_gosbell
Thank you for the quick response. After reading through the help file for Set-RsDataSourceReference, the examples don't appear to align with my goal.
I ended up picking apart the function "Set-RsItemDataSource' and grabbing the last section.
This ended up working and set my data source correctly.My goal was to set the report data source to this. Does this look sane?
Thanks!
Eric
- d_gosbell6 years agoSuper User
erico wrote:
This ended up working and set my data source correctly.If you figured out a script that works for you then that's great. If you are getting the result that you desire then that is probably proof in itself. I'm not sure how else you would measure the sanity of this 🙂
- erico6 years agoNew Member
Hi d_gosbell,
Maybe "safe" is a better word lol. The section of the function I took is different than your recommendation. My concern is about the downstream effects, despite its immediate success.
Your recommendation sets the DataSource like this...
$Proxy.SetItemReferences($item, @($dataSourceReference))I set the DataSource like this...
$rsProxy.SetItemDataSources($rsItem, $newDataSource)Thanks,
Eric