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 ModuleName
Expected 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.
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.1
Steps to reproduce
Currently when classes are defined within a module it seems the best way to access them us with the following.
Expected 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.
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