我可以从PowerShell的访问我的自定义.NET类?我的、自定义、PowerShell、NET

由网友(慦)分享简介:我有几个问题和疑虑有关PowerShell和.NET类。I have a couple of questions and doubts to regarding PowerShell and .NET Classes.我试图写一个类'富',将调用REST Web服务和执行某些任务。如果我在GAC部署类,那么我可以从...

我有几个问题和疑虑有关PowerShell和.NET类。

I have a couple of questions and doubts to regarding PowerShell and .NET Classes.

我试图写一个类'富',将调用REST Web服务和执行某些任务。如果我在GAC部署类,那么我可以从PowerShell的称呼呢?

I am trying to write a class 'foo' that will call Rest web service and perform some tasks. If I deploy the class in GAC then can I call it from PowerShell?

推荐答案

尝试:

ADD-TYPE -AssemblyName myassemblyname

[System.Reflection.Assembly]::LoadWithPartialName("myassemblyname")

访问方法/程序集的属性,你可以这样做:

to access method/properties of your assembly you can do this:

[myassemblyname]::mymethod()
[myassemblyname]::myproperty
阅读全文

相关推荐

最新文章