Skip to content

Commit

Permalink
fix: account location and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jformacek committed Feb 21, 2024
1 parent 53aba7e commit 299efee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Module/AutomationAccount/AutomationAccount.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function Connect-AutoAutomationAccount
{
throw "Subscription $Subscription no found"
}
"Connected to subscription $Subscription"
$script:AutomationAccountResourceId = "$($subscriptionObject.id)/resourceGroups/$ResourceGroup/providers/Microsoft.Automation/automationAccounts/$AutomationAccount"

$headers = Get-AutoAccessToken -AsHashTable
Expand All @@ -96,6 +97,7 @@ function Connect-AutoAutomationAccount
-Headers $headers `
-ErrorAction Stop
$script:accountLocation = $rslt.location
"Automation account validated; location: $($script:accountLocation)"
}
}

Expand Down Expand Up @@ -536,7 +538,7 @@ Function Add-AutoRunbook
process
{
try {
if($location = '') {$location = = $script:accountLocation}
if($location = '') {$location = $script:accountLocation}
write-verbose "Modifying runbook on $runbookUri"
$payload = @{
name = $Name
Expand Down
2 changes: 1 addition & 1 deletion vss-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifestVersion": 1,
"id": "Manage-AutomationAccount",
"name": "Manage-AutomationAccount",
"version": "1.9.36",
"version": "1.9.37",
"publisher": "GreyCorbelSolutions",
"targets": [
{
Expand Down

0 comments on commit 299efee

Please sign in to comment.