Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UrlFilter (WebFilter) #199

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions PowerFGT/Private/Confirm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,34 @@ Function Confirm-FGTVpnIpsecPhase2Interface {

$true
}

Function Confirm-FGTWebfilterUrlfilter {

Param (
[Parameter (Mandatory = $true)]
[object]$argument
)

#Check if it looks like a Web Filter URL Filter element

if ( -not ( $argument | get-member -name name -Membertype Properties)) {
throw "Element specified does not contain a name property."
}
if ( -not ( $argument | get-member -name comment -Membertype Properties)) {
throw "Element specified does not contain a comment property."
}
if ( -not ( $argument | get-member -name one-arm-ips-urlfilter -Membertype Properties)) {
throw "Element specified does not contain an one-arm-ips-urlfilter property."
}
if ( -not ( $argument | get-member -name ip-addr-block -Membertype Properties)) {
throw "Element specified does not contain an ip-addr-block property."
}
if ( -not ( $argument | get-member -name ip4-mapped-ip6 -Membertype Properties)) {
throw "Element specified does not contain an ip4-mapped-ip6 property."
}
if ( -not ( $argument | get-member -name entries -Membertype Properties)) {
throw "Element specified does not contain an entries property."
}

$true
}
Loading