PSClassUtils icon indicating copy to clipboard operation
PSClassUtils copied to clipboard

Enhance Functions to get Class information from files (using AST )

Open Stephanevg opened this issue 7 years ago • 1 comments

I would like to update the following functions to not only show 'only loaded' classes, but also get the same class information from a class located in a file.

The following functions should be enhanced:

  • [x] Get-CUClass
  • [x] Get-CUClassConstructor
  • [x] Get-CUClassMethod
  • [x] Get-CUClassProperty

These are the technical details I think this could work at best:

Add Parameter: -Path

  • [x] Possibility to read class from .PSM1 file
  • [x] Possibility to read class from .PS1 file
  • [ ] Should Throw if not of type [System.IO.FileInfo]
  • [ ] Should throw if doesn't have extension .psm1 or .ps1

I think the best and easiest way for that, would be to add a call to Get-CUAST in each of these functions, and add some filtering. This could also mean, that by extension, Get-CUAST might need some need options - Will see.

Stephanevg avatar Oct 04 '18 09:10 Stephanevg

We have taken another design approaoch, where Get-CUClass will be main entry point.

Stephanevg avatar Oct 29 '18 16:10 Stephanevg