[英]Writing PowerShell CmdLets in Python Dynamically
I want to be able to write PowerShell CmdLets using IronPython, and furthermore I need one CmdLet to look at the environment and add CmdLets to the PowerShell based on the contents.我希望能够使用 IronPython 编写 PowerShell CmdLets,此外,我需要一个 CmdLet 来查看环境并根据内容将 CmdLets 添加到 PowerShell 中。 For example, reading a directory, and adding a CmdLet Remove- for every filename it sees there.
例如,读取一个目录,并为它在那里看到的每个文件名添加一个 CmdLet Remove-。
As far as I know it can't be done!据我所知是做不到的!
The problem here is that an IronPython class is not a CLR class or compatible with a CLR class.这里的问题是 IronPython class 不是 CLR class 或与 CLR class 兼容。 A CLR class is static and an IronPython class is dynamic and the DLR, as far as I know, doesn't for example provide IronPython classes to have .net CLR attributes, which you need for CMDLET development.
A CLR class is static and an IronPython class is dynamic and the DLR, as far as I know, doesn't for example provide IronPython classes to have .net CLR attributes, which you need for CMDLET development.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.