Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. For example, reading a directory, and adding a CmdLet Remove- for every filename it sees there.

like image 753
moshez Avatar asked May 27 '11 01:05

moshez


1 Answers

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. 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.

like image 51
CosmosKey Avatar answered Oct 05 '22 23:10

CosmosKey