Giter VIP home page Giter VIP logo

Comments (6)

NicolasBn avatar NicolasBn commented on July 19, 2024 1

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

from powerfgt.

alagoutte avatar alagoutte commented on July 19, 2024 1

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

from powerfgt.

alagoutte avatar alagoutte commented on July 19, 2024

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

from powerfgt.

alagoutte avatar alagoutte commented on July 19, 2024

Thanks @NicolasBn !

from powerfgt.

alagoutte avatar alagoutte commented on July 19, 2024

can be close ?

from powerfgt.

poundy avatar poundy commented on July 19, 2024

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 ;) )

from powerfgt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.