Add feature: Function name improvment
I implemented it today to generate documentation of function calls inside my module
I use the Find-FUFunction and Write-FUGraph function in the both case, the function name returned have the case of the name modified and it's more difficult to read
for exemple, 'Find-FUFunction' become 'Find-Fufunction' and , in my case, funcitons like 'Get-PhysicalLocationByName' become 'Get-Physicallocationbyname'
Maybe good to have a switch to preserve the original name ? and everything is based on the display of the first occurence
I have a workaround for Find-FUFunction, I use the .RawFunctionAST.Name in place of the .Name of the object
$FunctionList = Find-FUFunction $PSM1Path
Foreach ($Fction in $FunctionList) {
$Fction.RawFunctionAST.Name
}
looking for the Write-FUGraph, I see 2 different approach:
- add a switch -> 1.1 change the 2 functions in class FUUtility::getFunction to have 1 more parameter to keep the original format 1.2 add switch to Find-FUFunction (like -KeepFunctionNameFormat) and change the call when creating the object to take it in count 1.3 add switch to write-fugraph (like -KeepFunctionNameFormat) and add it when calling find-function
OR
- add just a parameter to write-FUgraph to allow to pass to it the data if not present, just call the find-function if present, don't call find-function and use the array in parameter
it's fast and allow to do the trick, we call ourself the find-fufunction command, change the display name and send it to generate the graph
it allow also to be more logic with the name of the function, write-FUgraph generate a graphic and, normally, doesn't have to retrieve the data (but keep the data retrieval to avoid breaking change)
I think i normalize the name of the function because, if the for example you have two calls for the same function, and they are spelled differently ( for example get-something and Get-SomeThing) you'll have two different entries ..., but i can still implement the functionnality if you wish !
ok @Lasio74 so, i'm going to make some changes. And as discussed in slack, you are right, write-fugraph should only output a graph... ! dont remember why i build it the way it is now.
Write-FUGraph should only accept [FuFunction[]] objects ... !
I'll also implement the requested feature !
code available in the Issues Branch ! keep me informed :) -notitlecase switch for find-fufunction write-fufunction now accepts data from find-fufunction via the -inputobject parameter