You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there are no classes defined in the script or module, the Classes value would be null. This shouldn't create any problems for older versions of PowerShell.
Expected Behavior
If a module or script defines PowerShell classes, I would like them to be discoverable before installing or importing the module, such as in the Includes hash table in the PSRepositoryInfo object. Currently, the Includes hash table has keys for functions and DSCResources, but not for classes.
Current Behavior
PS C:\ps-test> (Find-Module PoshRsJob -RequiredVersion 1.7.0.0).Includes
Name Value
---- -----
Function {Get-RSJob, Receive-RSJob, Remove-RSJob, Start-RSJob...}
RoleCapability {}
Command {Get-RSJob, Receive-RSJob, Remove-RSJob, Start-RSJob...}
DscResource {}
Workflow {}
Cmdlet {}
Possible Solution
Add a Class key to the Includes hash table:
PS C:\ps-test> (Find-Module PoshRsJob -RequiredVersion 1.7.0.0).Includes
Name Value
---- -----
Function {Get-RSJob, Receive-RSJob, Remove-RSJob, Start-RSJob...}
RoleCapability {}
Command {Get-RSJob, Receive-RSJob, Remove-RSJob, Start-RSJob...}
DscResource {}
Workflow {}
Cmdlet {}
Class {V2UsingVariable, RSRunspacePool, RSJob}
June Blender (@juneb) I'd like to take a stab at implementing this but am running into some roadblocks with the multiple ways a class can be defined. I found your article about finding classes in modules but it seems to have some limitations. Do you know how to get the list of exported classes when it's defined in ScriptsToProcess or NestedModules? If not we may need to wait until PowerShell/PowerShell#6293 is complete.
Activity
bmanikm commentedon Jan 6, 2017
June Blender (@juneb) PowerShellGet needs to work on PS 3.0 or newer. Classes feature got added in PS 5.0.
juneb commentedon Jan 6, 2017
If there are no classes defined in the script or module, the Classes value would be null. This shouldn't create any problems for older versions of PowerShell.
bmanikm commentedon Jan 6, 2017
June Blender (@juneb) Could you please update the issue with more details as mentioned in the issue template?
juneb commentedon Jan 6, 2017
Sure. It's a feature request, not a bug. :)
Expected Behavior
If a module or script defines PowerShell classes, I would like them to be discoverable before installing or importing the module, such as in the Includes hash table in the PSRepositoryInfo object. Currently, the Includes hash table has keys for functions and DSCResources, but not for classes.
Current Behavior
Possible Solution
Add a Class key to the Includes hash table:
Environment:
ThomasNieto commentedon May 30, 2019
June Blender (@juneb) I'd like to take a stab at implementing this but am running into some roadblocks with the multiple ways a class can be defined. I found your article about finding classes in modules but it seems to have some limitations. Do you know how to get the list of exported classes when it's defined in
ScriptsToProcessorNestedModules? If not we may need to wait until PowerShell/PowerShell#6293 is complete.