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-CUClass list enums as a class. #103

Open
Stephanevg opened this issue Mar 30, 2019 · 1 comment
Open

Get-CUClass list enums as a class. #103

Stephanevg opened this issue Mar 30, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@Stephanevg
Copy link
Owner

Given the following powershell module

Enum ComputerType {
    Server
    Client
}

Class Computer {
    [String]$Name
    [ComputerType]$Type
}

Function Get-InternalStuff {
    #Does internal stuff 
}

Function Get-ComputerData {
    #Does stuff
}

Export-ModuleMember -Function Get-ComputerData 
Import-Module PsClassUtils

Get-CUClass


Name            : ComputerType
Property        : {Server, Client}
Constructor     :
Method          :
IsInherited     : False
ParentClassName :
Path            : C:\Users\taavast3\OneDrive\Repo\Projects\OpenSource\Stephanevg.github.io\_Drafts\plop.psm1

Name            : Computer
Property        : {Name, Type}
Constructor     :
Method          :
IsInherited     : False
ParentClassName :
Path            : C:\Users\taavast3\OneDrive\Repo\Projects\OpenSource\Stephanevg.github.io\_Drafts\plop.psm1

It should not Show the Enum.

@Stephanevg Stephanevg added the bug Something isn't working label Mar 30, 2019
@LxLeChat
Copy link
Collaborator

An If Block is missing in Get-CUClass
You should had the following If statement after the Foreach statement

Foreach ( $x in (Get-CULoadedClass @ClassParams ) ) {
                If ( !$x.IsEnum ){

LxLeChat added a commit to LxLeChat/PSClassUtils that referenced this issue Apr 20, 2019
Fixing issue Stephanevg#104
Fixing issue Stephanevg#103
Add Pipeline support for Get-CUEnum Stephanevg#102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants