Last active
August 3, 2022 20:24
-
-
Save SQLvariant/4e1bc0f5a83462c99518d07025255d66 to your computer and use it in GitHub Desktop.
This simple PowerShell script shows you how to copy activities from one ADF pipeline, and add those activities to another ADF pipeline.
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