惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
月光博客
月光博客
量子位
大猫的无限游戏
大猫的无限游戏
Stack Overflow Blog
Stack Overflow Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
P
Proofpoint News Feed
B
Blog RSS Feed
美团技术团队
腾讯CDC
C
Check Point Blog
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
Recent Announcements
Recent Announcements
J
Java Code Geeks
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享

博客园 - 挖土.

学笛子 PowerShell: Try...Catch...Finally 实现方法 How to set the compuder to auto login 让 PowerShell 2.0 支持 DotNet FrameWork 4.0 用 Powershell 安装Dotnet FrameWorrk 4.0 PowerShell 调用.netFramework中的静态函数 PowerGUI Visual Studio is now in beta! PowerShell 中定义和使用泛型 PowerShell中Add-Content 和 Out-File 的区别 给string加几个扩展方法 加快 c++ Builder 5编译速度 Windows 7 下的 SUBST 命令 How to configure the BDE for Windows Vista/7 - 挖土. Linker problems with Borland builder SQL 中的中位值计算 Windows 7的“上帝模式” XML 序列化和反序列化详例代码 给存储过程传递一个表 VSIdeTesthost installation issue - 挖土.
PowerShell 如何引用DLL
挖土. · 2010-07-29 · via 博客园 - 挖土.

如果DLL是在Dotnet Framework基础上,Visual Studio编译出来的,可以按照如下方法在PowerShell中引用。

 1 #引入DLL
 2 [System.Reflection.Assembly]::LoadFrom('D:\Test\MCF.Infrastructure.DTS.dll') | Out-null
 3 [System.Reflection.Assembly]::LoadFrom('D:\MCF\MCF.Infra.dll') | Out-null
 4 
 5 #创建对象
 6 $log = new-object MCF.Infra.Logger
 7 $lib = new-object MCF.Infrastructure.DTS.DTSClientLib($log)
 8  
 9 #调用类库的方法
10 $status = $lib.GetJobStatus() 

因为在创建 DTSClientLib 对象时,可以传入 null,可以这样

1 #引入DLL
2 [System.Reflection.Assembly]::LoadFrom('D:\Test\MCF.Infrastructure.DTS.dll') | Out-null
3 
4 #创建对象
5 $lib = new-object MCF.Infrastructure.DTS.DTSClientLib @($null)
6 
7 #调用类库的方法
8 $status = $lib.GetJobStatus()