Skip to content

Commit

Permalink
Use Get-OPNsenseItem
Browse files Browse the repository at this point in the history
  • Loading branch information
fvanroie committed Jun 15, 2018
1 parent 765073a commit 1bb2512
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Plugins/HAProxy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function New-OPNsenseHAProxyObject {
$snapAfter = Invoke-OPNsenseCommand haproxy settings $("search{0}s" -f $ObjectType.ToLower()) -Form @{ searchPhrase = $Item.Name} -Property rows
$uuid = Compare-Object -ReferenceObject $snapBefore -DifferenceObject $snapAfter -Property Uuid | Select-Object -ExpandProperty Uuid

$result = Get-OPNsenseHAProxyDetail -ObjectType $ObjectType -Uuid $Uuid
$result = Get-OPNsenseItem -HAProxy $ObjectType -Uuid $Uuid
#if ($PassThru) {
$results += $result
#}
Expand Down Expand Up @@ -451,7 +451,7 @@ function Set-OPNsenseHAProxyObject {
# return Invoke-OPNsenseCommand haproxy settings get | Select-Object -ExpandProperty haproxy | Select-Object -ExpandProperty $("{0}s" -f $ObjectType) | Select-Object -ExpandProperty $("{0}s" -f $ObjectType)
$result = Invoke-OPNsenseCommand haproxy settings $("set{0}/{1}" -f $ObjectType.ToLower(), $Uuid) -Json @{ $ObjectType.ToLower() = $Item }
if (Test-OPNsenseApiResult $result) {
$result = Get-OPNsenseHAProxyDetail -ObjectType $ObjectType -Uuid $Uuid
$result = Get-OPNsenseItem -HAProxy $ObjectType -Uuid $Uuid
if ($PassThru) {
$results += $result
}
Expand Down

0 comments on commit 1bb2512

Please sign in to comment.