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

Get-FGTFirewallAddressGroup return showing only 4x member entries... #87

Open
poundy opened this issue Mar 3, 2020 · 6 comments
Open
Labels
enhancement New feature or request

Comments

@poundy
Copy link
Contributor

poundy commented Mar 3, 2020

I totally know how to get access to the .Member property, and suspect that this is just a PS behaviour that can't be overridden, but it'd be nice if it could.
When you use Get-FGTFirewallAddressMember, the output shows up to 4 members and then an ellipsis of members... Is there any way to influence that to report them all ?

uuid          : 37231bb8-ebc3-51e9-dd1f-a50c2fa0b8cf
member        : {@{q_origin_key=H_10.1.0.1; name=H_10.1.0.1}, 
                @{q_origin_key=H_10.1.0.2; name=H_10.1.0.2}, 
                @{q_origin_key=H_10.1.0.3; name=H_10.1.0.3}, 
                @{q_origin_key=H_10.1.0.4; name=H_10.1.0.4}...}
comment       : 
@alagoutte
Copy link
Contributor

Good question but i don't known... (i think it is a settings of powershelll)...

@NicolasBn
Copy link

You can override the output of function. But you need to custom the type of object that it returns.

$Object = [PSCustomObject]@{}
$Object.PStypeNames.Clear()
$Object.PStypeNames.Add(MyType)

You can see the new type with Get-Member :

$Object | Get-Member


   TypeName: MyType

Name        MemberType Definition
----        ---------- ----------
Equals      Method     bool Equals(System.Object obj)
GetHashCode Method     int GetHashCode()
GetType     Method     type GetType()
ToString    Method     string ToString()

After that, you need to add View in .format.ps1xml.
Look at about_format.ps1xml

@alagoutte
Copy link
Contributor

Thanks @NicolasBn !

@alagoutte
Copy link
Contributor

can be close ?

@poundy
Copy link
Contributor Author

poundy commented Mar 10, 2020

This one I think I would like to put as a future improvement - so that the return from the get-* was a little clearer. Some of my use-cases are very clearly inside a script and the return isn't that important as I'll hide the output and manage it myself, but I think the interactive use-case could definitely benefit from that improvement.

I have no idea how best to manage this kind of issue/item... but have no qualms if you just want it closed.

I haven't quite wrapped my mind about how I'd go about addressing this as per the above, but haven't looked deep enough (I'm sidetracking myself wanting to see if the API will handle Add-FGTFirewallPolicy with a PolicyID - but more on that later ;) )

@alagoutte alagoutte added the enhancement New feature or request label Mar 10, 2020
@alagoutte
Copy link
Contributor

Ok, i kept for enhance

I will look a day for try @NicolasBn solution

but actually, I'm only display the direct output of API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants