Skip to content

Instantly share code, notes, and snippets.

@RichieBzzzt
Created November 8, 2018 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RichieBzzzt/22790520f48166ef610cbb652c2c8ab7 to your computer and use it in GitHub Desktop.
Save RichieBzzzt/22790520f48166ef610cbb652c2c8ab7 to your computer and use it in GitHub Desktop.
param(
[parameter(Mandatory = $true)] [string]$ResourceGroupName,
[parameter(Mandatory = $true)] [string]$dataFactoryName,
[parameter(Mandatory = $true)] [string]$location,
[parameter(Mandatory = $false)] [string]$environmentsuffix,
[parameter(Mandatory = $false)] [string]$clientID,
[parameter(Mandatory = $false)] [string]$tenantID,
[parameter(Mandatory = $false)] [string]$key
)
if ([string]::IsNullOrEmpty($(Get-AzureRmContext).Account)) {
Add-AzureRmAccount
}
$ADF_Triggers = Get-AzureRmDataFactoryV2Trigger -ResourceGroupName $ResourceGroupName -DataFactoryName $dataFactoryName -ErrorVariable notPresent -ErrorAction SilentlyContinue
Write-Host $ADF_Triggers.Name
if ($notPresent) {
Write-Host "Trigger does not exist. Nothing to enable!"
}
else {
$ADF_Triggers | ForEach-Object {
Write-Host "Enabling Pipeline Trigger $($_.name)"
Start-AzureRmDataFactoryV2Trigger -ResourceGroupName $ResourceGroupName -DataFactoryName $dataFactoryName -Name $_.name -Force
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment