Skip to content

Commit

Permalink
added add-fgtfirewallservicecustom
Browse files Browse the repository at this point in the history
  • Loading branch information
Joeym0180 committed Sep 14, 2024
1 parent eb56663 commit 78b1dd5
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion PowerFGT/Public/cmdb/firewall/service/custom.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,44 @@ function Get-FGTFirewallServiceCustom {

End {
}
}
}


function Add-FGTFirewallServiceCustom {
param (
[Parameter(Mandatory)]
[string]
$name,
[Parameter()]
[string]
$tcprange,
[Parameter()]
[string]
$udprange,
[Parameter()]
[string]
$category,
[Parameter()]
[string]
$vdom = 'root'

)



$data = @{
name = $name
}
if (![string]::IsNullOrEmpty($tcprange)) {
$data.'tcp-portrange' = $tcprange
}
if (![string]::IsNullOrEmpty($udprange)) {
$data.'udp-portrange' = $udprange
}
if (![string]::IsNullOrEmpty($category)) {
$data.category = @{
q_origin_key = $category
}
}
Invoke-FGTRestMethod -uri 'api/v2/cmdb/firewall.service/custom' -vdom $vdom -method POST -body $data
}

0 comments on commit 78b1dd5

Please sign in to comment.