Last active
August 3, 2022 20:24
This simple PowerShell script shows you how to copy activities from one ADF pipeline, and add those activities to another ADF pipeline.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<# # Copying Pipeline Activities | |
This simple PowerShell script shows you how to copy activities from one ADF pipeline, and add those activities to another ADF pipeline. #> | |
$DonorPipe = 'A' | |
$RecevingPipe = 'B' | |
$DonorPipelineContents = $null | |
$RecevingPipeline = $null | |
$DonorPipelineContents = Get-Content -Path ".\$DonorPipe.json" | ConvertFrom-Json -Depth 20 | |
$RecevingPipeline = Get-Content -Path ".\$RecevingPipe.json" | ConvertFrom-Json -Depth 20 | |
$RecevingPipeline.properties.activities.Count | SELECT @{label='ExistingPipelineActivitiesBefore';expression ={$_}} | fl | |
$RecevingPipeline.properties.activities += $DonorPipelineContents.properties.activities[4] | |
$RecevingPipeline.properties.activities += $DonorPipelineContents.properties.activities[5] | |
$RecevingPipeline.properties.activities.Count | SELECT @{Name='ExistingPipelineActivitiesAfter';expression ={$_}} | fl | |
$RecevingPipelineNewContents = $RecevingPipeline | ConvertTo-Json -Depth 20 | |
Set-Content -Path ".\$RecevingPipe.json" -Value $RecevingPipelineNewContents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment