Skip to content

Commit

Permalink
Review feedback: if/else
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljurek authored and azure-sdk committed May 22, 2024
1 parent 2f99b0b commit 42d4bed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions eng/common/TestResources/deploy-test-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,18 @@ steps:
Inline: |
eng/common/scripts/Import-AzModules.ps1
$subscriptionConfiguration = @'
${{ parameters.SubscriptionConfiguration }}
'@ | ConvertFrom-Json -AsHashtable;
if ('${{ parameters.SubscriptionConfigurationFilePath }}' -ne '') {
$subscriptionConfiguration = `
Get-Content '${{ parameters.SubscriptionConfigurationFilePath }}' `
| ConvertFrom-Json -AsHashtable;
} else {
# Multiline string termination ('@) needs to be at the beginning
# of the line
$subscriptionConfiguration = @'
${{ parameters.SubscriptionConfiguration }}
'@ | ConvertFrom-Json -AsHashtable;
}
# The subscriptionConfiguration may have ArmTemplateParameters defined, so
Expand Down
10 changes: 7 additions & 3 deletions eng/common/TestResources/remove-test-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,18 @@ steps:
Inline: |
eng/common/scripts/Import-AzModules.ps1
$subscriptionConfiguration = @"
${{ parameters.SubscriptionConfiguration }}
"@ | ConvertFrom-Json -AsHashtable;
if ('${{ parameters.SubscriptionConfigurationFilePath }}' -ne '') {
$subscriptionConfiguration = `
Get-Content '${{ parameters.SubscriptionConfigurationFilePath }}' `
| ConvertFrom-Json -AsHashtable;
} else {
# Multiline string termination ("@) needs to be at the beginning
# of the line
$subscriptionConfiguration = @"
${{ parameters.SubscriptionConfiguration }}
"@ | ConvertFrom-Json -AsHashtable;
}
eng/common/TestResources/Remove-TestResources.ps1 `
Expand Down

0 comments on commit 42d4bed

Please sign in to comment.