且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

相当于C#的"使用"在PowerShell中的关键字?

更新时间:2021-07-06 08:42:22

看看这个博客文章一对夫妇多年前:http://blogs.msdn.com/richardb/archive/2007/02/21/add-types-ps1-poor-man-s-using-for-powershell.aspx

Check out this blog post from a couple years ago: http://blogs.msdn.com/richardb/archive/2007/02/21/add-types-ps1-poor-man-s-using-for-powershell.aspx

基本上我做的是抓取组件平凡的类型,然后写一个使用添加会员添加它们​​(结构化的方式)来我所关心的对象构造。

Basically what I do is crawl the assembly for nontrivial types, then write a "constructor" that uses Add-Member add them (in a structured way) to the objects I care about.

也看到这个后续职位: http://richardberg.net/blog/?p=38

See also this followup post: http://richardberg.net/blog/?p=38