共用方式為


IronPython Sample: IPPowerShell

This sample shows how to use PowerShell commands from IronPython by invoking the PowerShell API(s) directly and also by using a nice Python helper class. The samples use both of these techniques to detect whether a host meets some of the minimum system requirements for playing Age of Empires III Trial edition.  The readme.htm in the download (download page: IronPython-1.0-Samples-IPPowerShell.zip) will get you started.

By utilizing managed PowerShell API(s) from IronPython, it becomes downright easy to perform a runtime inspection of the system. As an example, you can determine how much memory your video card has installed on it using only a couple lines of IronPython code. To make working with PowerShell even easier, the “powershell.py” module (included with this sample) allows you to run PowerShell cmdlets in a very elegant and object-oriented manner.

Comments