Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Windows PowerShell Programming ISBN: 978-0-470-17393-0
This is the forum to discuss the Wrox book Professional Windows PowerShell Programming: Snapins, Cmdlets, Hosts and Providers by Arul Kumaravel, Jon White, Michael Naixin Li, Scott Happell, Guohui Xie, Krishna C. Vutukuri; ISBN: 9780470173930
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Windows PowerShell Programming ISBN: 978-0-470-17393-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 17th, 2008, 01:42 AM
Registered User
 
Join Date: Dec 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default getting formatted output in hosted powershell

I've followed along with the examples in chapter 6 (hosting powershell in applications) and have a working app. I have a problem when trying to get the output of a pipeline like "dir | format-table". All of the examples show simply calling the ToString() method on each of the PSObjects in the collection returned (which works if you leave the format-table off), but the objects returned by the format-table cmdlet are apparently internal not-really-documented (couldn't find them in MSDN, for example) and don't implement anything for ToString() other than outputing the typename.

For example, I get the following:
Microsoft.PowerShell.Commands.Internal.Format.Form atStartData
Microsoft.PowerShell.Commands.Internal.Format.Grou pStartData
Microsoft.PowerShell.Commands.Internal.Format.Form atEntryData
Microsoft.PowerShell.Commands.Internal.Format.Form atEntryData
Microsoft.PowerShell.Commands.Internal.Format.Form atEntryData
Microsoft.PowerShell.Commands.Internal.Format.Form atEntryData
Microsoft.PowerShell.Commands.Internal.Format.Grou pEndData
Microsoft.PowerShell.Commands.Internal.Format.Form atEndData

I have grabbed these objects in a real powershell session (not in my app) and tried to figure out how to get anything resembling output out of them to no avail. Can you point me somewhere helpful?
 
Old January 8th, 2009, 09:20 AM
Registered User
 
Join Date: Apr 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default RE: getting formatted output in hosted powershell

Quote:
Originally Posted by Mike Shepard View Post
I've followed along with the examples in chapter 6 (hosting powershell in applications) and have a working app. I have a problem when trying to get the output of a pipeline like "dir | format-table". All of the examples show simply calling the ToString() method on each of the PSObjects in the collection returned (which works if you leave the format-table off), but the objects returned by the format-table cmdlet are apparently internal not-really-documented (couldn't find them in MSDN, for example) and don't implement anything for ToString() other than outputing the typename.

For example, I get the following:
Microsoft.PowerShell.Commands.Internal.Format.Form atStartData
Microsoft.PowerShell.Commands.Internal.Format.Grou pStartData
Microsoft.PowerShell.Commands.Internal.Format.Form atEntryData
Microsoft.PowerShell.Commands.Internal.Format.Form atEntryData
Microsoft.PowerShell.Commands.Internal.Format.Form atEntryData
Microsoft.PowerShell.Commands.Internal.Format.Form atEntryData
Microsoft.PowerShell.Commands.Internal.Format.Grou pEndData
Microsoft.PowerShell.Commands.Internal.Format.Form atEndData

I have grabbed these objects in a real powershell session (not in my app) and tried to figure out how to get anything resembling output out of them to no avail. Can you point me somewhere helpful?
Format-Table is meant to be the last cmdlet used in a pipeline. Once you use Format-Table, you're basically stuck with the objects that are outputted, and you cannnot do any further manipulation of the objects that are returned.

Maybe you can share more details on what you're trying to accomplish?
 
Old October 8th, 2009, 03:42 AM
Registered User
 
Join Date: Oct 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I too have the same problem. I am trying to display the objects returned from my cmdlet to the console. But inside the host I donot have any idea how to handle these formated table data objects which appear to be internal to the PS host.

Would be great if someone can clarify

Thanks
 
Old October 8th, 2009, 03:57 AM
Registered User
 
Join Date: Oct 2009
Location: China
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to amandaboard
Default Optical Mark Reader Scanner

NANHAO Optical Mark Reader (OMR Scanner) is a high speed data capture device which is mainly used for recognizing the filled datas in all kind of info-Forms. It’s highest reading speed can reach nearly 8000 info-Forms per hour (A4)
NANHAO Optical Mark Reader (OMR Scanner) has been largely used in all kind areas of high speed data processing, such as school examination, vote, transportation, human resources, fiscal taxation and finance and so on.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Recursive Query for Formatted Output Itech SQL Server 2005 11 June 12th, 2008 04:32 PM
Hosted Form of Component angelboy C# 2005 7 March 31st, 2008 02:36 PM
Hosted BeerHouse and sub directory gb012993 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 January 16th, 2008 01:48 AM
Events with IIS hosted remoting koraykazgan C# 1 May 1st, 2007 03:49 PM
Moving App to Hosted site dthoma128 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 13 December 19th, 2006 03:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.