Created
December 17, 2018 23:28
-
-
Save fluxdigital/650c3b30a71cebd92b2f36c6a50116b0 to your computer and use it in GitHub Desktop.
Update a Rendering Datasource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Swap-DataSource ($item, $renderingToUpdate, $renderingDataSourceIdToAdd, $useFinalLayout) { | |
| $renderingItem = Get-Item -Path $renderingToUpdate.ItemID | |
| Write-Host "Swaping Rendering Datasource: $($renderingId.UniqueID) - '$($renderingItem.Name)' to: $($renderingDataSourceIdToAdd) for Item: $($item.Name)" | |
| $renderingToUpdate.Datasource = $renderingDataSourceToAdd | |
| Set-Rendering -Item $item -Instance $renderingToUpdate -FinalLayout:$useFinalLayout | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment