Skip to content

Commit

Permalink
fix: fixed casing of parameter and fixed return param of Set-AzApiMan…
Browse files Browse the repository at this point in the history
…agementPolicy command (#324)

Co-authored-by: Pim Simons <[email protected]>
  • Loading branch information
pim-simons and pim-simons authored Aug 26, 2022
1 parent 2c31e34 commit 36a72e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ param(
[Parameter(Mandatory = $true)][string] $ResourceGroupName,
[Parameter(Mandatory = $true)][string] $ServiceName,
[Parameter(Mandatory = $true)][string] $ApiId,
[Parameter(Mandatory = $true)][string] $policyFilePath
[Parameter(Mandatory = $true)][string] $PolicyFilePath
)

$apim = Get-AzApiManagement -ResourceGroupName $ResourceGroupName -Name $ServiceName
Expand All @@ -12,7 +12,7 @@ if ($apim -eq $null) {
$apimContext = New-AzApiManagementContext -ResourceGroupName $ResourceGroupName -ServiceName $ServiceName

Write-Host "Updating policy of API '$ApiId'"
$result = Set-AzApiManagementPolicy -Context $apimContext -ApiId $ApiId -PolicyFilePath $policyFilePath
$result = Set-AzApiManagementPolicy -Context $apimContext -ApiId $ApiId -PolicyFilePath $PolicyFilePath -PassThru
if ($result) {
Write-Host "Successfully updated API policy"
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if ($apim -eq $null) {
$apimContext = New-AzApiManagementContext -ResourceGroupName $ResourceGroupName -ServiceName $ServiceName

Write-Host "Updating policy of the operation '$OperationId' in API '$ApiId'"
$result = Set-AzApiManagementPolicy -Context $apimContext -ApiId $ApiId -OperationId $OperationId -PolicyFilePath $PolicyFilePath
$result = Set-AzApiManagementPolicy -Context $apimContext -ApiId $ApiId -OperationId $OperationId -PolicyFilePath $PolicyFilePath -PassThru
if ($result) {
Write-Host "Successfully updated the operation policy"
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if ($apim -eq $null) {
$apimContext = New-AzApiManagementContext -ResourceGroupName $ResourceGroupName -ServiceName $ServiceName

Write-Host "Updating policy of product '$ProductId'"
$result = Set-AzApiManagementPolicy -Context $apimContext -ProductId $ProductId -PolicyFilePath $PolicyFilePath
$result = Set-AzApiManagementPolicy -Context $apimContext -ProductId $ProductId -PolicyFilePath $PolicyFilePath -PassThru
if ($result) {
Write-Host "Successfully updated the product policy"
} else {
Expand Down

0 comments on commit 36a72e7

Please sign in to comment.