Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Accessing custom types output from custom cmdlet's in C# GUI

Reply
 
Old 09-19-2008   #1 (permalink)
Dan Finucane


 
 

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 SpecsSystem Spec
Reply

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


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46