![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Accessing custom types output from custom cmdlet's in C# GUI I am building a set of tools to manage my system. I like the idea of building PowerShell cmdlets to manage my system and then having a GUI that puts a front end on the cmdlets. I get scripting and a GUI with one code base. That is the goal. My cmdlets output types defined in the cmdlet. Some of the types contain object graphs of arbitrary depth - they are typical .NET types which might contain with collections which in turn contain objects with properties some of which might be collections. I wanted to minimize the coupling between the GUI and the cmdlet. I can invoke a pipeline which executes the cmdlets and they return their results without trouble. The problem is that I cannot access the cmdlet's types in C# without adding a reference to the cmdlet's assembly. Adding that reference is a coupling I was trying to avoid. I could use the property bag to pull the values out of the custom types but that is cumbersome with types that have object graphs of any depth. What should I do? Add the reference. Pull the types out of the cmdlet and into its own assembly and then share that assembly between the GUI and cmdlet. Use reflection. Write the GUI in IronRuby and access the types without a reference. Does anybody know how Microsoft does this with it's exchange management shell? |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Can I create a Default output format for custom objects | PowerShell | |||
| types.custom.ps1xml for custom members | PowerShell | |||
| custom types for System.Int32 | PowerShell | |||
| Unable to associate file types to custom application | Vista file management | |||