Open
Conversation
Contributor
|
the CI is not happy : Missing BOM encoding for non-ASCII encoded file 'WebfilterUrlfilter.Tests.ps1' => you need to check the BOM of the file (use the same like other file) |
alagoutte
requested changes
Nov 16, 2022
| Process { | ||
|
|
||
| $invokeParams = @{ } | ||
| if ( $PsBoundParameters.ContainsKey('skip') ) { |
| } | ||
|
|
||
| if ( Get-FGTWebfilterUrlfilter -connection $connection @invokeParams -name $name ) { | ||
| Throw "Already a URL profile object using the same name" |
|
|
||
| Param( | ||
| [Parameter (Mandatory = $false)] | ||
| [string]$id, |
Contributor
Author
There was a problem hiding this comment.
It takes the next ID available, so it doesn't need to be mandatory or specified
| $_entry = new-Object -TypeName PSObject | ||
|
|
||
| if ( $PsBoundParameters.ContainsKey('url_id') ) { | ||
| $_entry | add-member -name "id" -membertype NoteProperty -Value $url_id |
Contributor
Author
There was a problem hiding this comment.
id = ID of URL Filter profile
url_id = ID of URL inside that profile
So id =/= url_id
|
|
||
| $urlfilter | add-member -name "name" -membertype NoteProperty -Value $name | ||
|
|
||
| $urlfilter | add-member -name "id" -membertype NoteProperty -Value $id |
| $_entry = new-Object -TypeName PSObject | ||
|
|
||
| if ( $PsBoundParameters.ContainsKey('url_id') ) { | ||
| $_entry | add-member -name "id" -membertype NoteProperty -Value $url_id |
|
|
||
| $_urlfilter | add-member -name "entries" -membertype NoteProperty -Value $urlfilter.entries | ||
|
|
||
| if ( $PsBoundParameters.ContainsKey('visibility') ) { |
Contributor
There was a problem hiding this comment.
there is always visibility ?
| [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'high')] | ||
| Param( | ||
| [Parameter (Mandatory = $true, ValueFromPipeline = $true, Position = 1)] | ||
| #[ValidateScript({ Confirm-FGTWebfilterUrlfilter $_ })] |
|
|
||
| } | ||
|
|
||
| Describe "Add WebFilter UrlFilter" { |
| { Add-FGTWebfilterUrlfilter -name $pester_url1 -url_id 1 -url_type simple -url powerfgt.com -action allow -status enable } | Should -Throw "Already a URL profile object using the same name" | ||
| } | ||
|
|
||
| } No newline at end of file |
Contributor
There was a problem hiding this comment.
Missing Set and Remove test too
7b8256a to
04852db
Compare
added 3 commits
August 26, 2024 16:53
Contributor
Author
|
/azp run |
|
Commenter does not have sufficient privileges for PR 199 in repo FortiPower/PowerFGT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.