Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dutt0 committed Dec 18, 2024
1 parent d1d99ec commit d2a7ae1
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Function Add-GSAAutomationRunbooks {
Write-Verbose "Importing 'main' Runbook." #main runbook, runs the modules.
try {
$ErrorActionPreference = 'Stop'

Write-Verbose "`tImporting 'main' Runbook to Azure Automation Account '$($config['runtime']['AutomationAccountName'])'"
Import-AzAutomationRunbook -Name $mainRunbookName -Path "$PSScriptRoot/../../../../setup/main.ps1" -Description $mainRunbookDescription -Type PowerShell -Published `
-ResourceGroupName $config['runtime']['resourceGroup'] -AutomationAccountName $config['runtime']['autoMationAccountName'] -Tags @{version = $config['runtime']['tagsTable'].ReleaseVersion } | Out-Null
Expand All @@ -39,7 +38,6 @@ Function Add-GSAAutomationRunbooks {
Write-Verbose "Creating schedule for 'main' Runbook."
try {
$ErrorActionPreference = 'Stop'

Write-Verbose "`tCreating schedule for 'main' Runbook."
New-AzAutomationSchedule -ResourceGroupName $config['runtime']['resourceGroup'] -AutomationAccountName $config['runtime']['autoMationAccountName'] -Name "GR-Every6hours" -StartTime (get-date).AddHours(1) -HourInterval 6 | Out-Null
}
Expand All @@ -55,7 +53,7 @@ Function Add-GSAAutomationRunbooks {
Register-AzAutomationScheduledRunbook -Name $mainRunbookName -ResourceGroupName $config['runtime']['resourceGroup'] -AutomationAccountName $config['runtime']['autoMationAccountName'] -ScheduleName "GR-Every6hours" | Out-Null
}
catch {
Write-Error "Error importing 'main' Runbook. $_"
Write-Error "Error registering 'main' Runbook to schedule. $_"
break
}
#endregion
Expand Down

0 comments on commit d2a7ae1

Please sign in to comment.