How to use interfaces in Powershell defined via Add-Type?

前端 未结 3 1591
南笙
南笙 2021-01-16 09:22

I developed a PowerShell module that relied on a .NET Assembly for some operations.
I refactored this module to not need that Assembly and noticed some strange behavior,

3条回答
  •  北海茫月
    2021-01-16 10:23

    Why not defining all classes in C# in a separate file, than add it as Add-Type -path MyClasses.cs This way it will work with older PS versions

提交回复
热议问题