Comments (6)
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.
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.
Good question but i don't known... (i think it is a settings of powershelll)...
from powerfgt.
Thanks @NicolasBn !
from powerfgt.
can be close ?
from powerfgt.
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)
- Question about use Remove-FGTFirewallPolicy HOT 2
- Set/Remove-FGTFirewallAddress not working when piping object from Get-FGTFirewallAddress HOT 4
- Failure to connect when post-login-banner is configured HOT 6
- Error connecting with v0.5.0 HOT 2
- Get IPsec vpn phase1 PSK HOT 6
- Filtering does not work correctly in old operating systems (5.x) HOT 10
- Align Filtering with FortiManager (PowerFMG) HOT 1
- Display the progress BAR HOT 5
- Bug with diacritics HOT 9
- Upgrade Path HOT 3
- Upgrade path error HOT 2
- Backup config isn't working HOT 1
- When using the "Remove-FGTFirewallAddressGroupMember" cmdlet, nothing happens HOT 12
- Reg Connect-FGT HOT 4
- Connecting with FortiToken? HOT 3
- Getting Arp Table HOT 2
- Can you create new users? HOT 9
- Upload and replace renewed SSL Certificate offline HOT 3
- Move-FGTFirewallPolicy function problem HOT 1
- Custom HTTPS port? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerfgt.