-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Open
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closeThe bot will ignore these and not auto-closeWG-Languageparser, language semanticsparser, language semantics
Description
Steps to reproduce
Currently when classes are defined within a module it seems the best way to access them us with the following.
using module ModuleName
[Foo]::new()
Get-Module ModuleNameExpected behavior
Like other module members (functions, cmdlets, variables, aliases, etc) it would be helpful to be able to declare classes and export them as module members. Module manifests could have a section for this.
ClassesToExport = @()Using them would feel more in line with how the rest of the language works. With the current implementation I find myself creating C# classes and importing the .cs file with Add-Type.
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.1
PSEdition Core
GitCommitId v6.0.1
OS Microsoft Windows 10.0.15063
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.15063.909
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.909
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closeThe bot will ignore these and not auto-closeWG-Languageparser, language semanticsparser, language semantics