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

December 17th, 2008, 01:42 AM
|
|
Registered User
|
|
Join Date: Dec 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|

January 8th, 2009, 09:20 AM
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
RE: getting formatted output in hosted powershell
Quote:
Originally Posted by Mike Shepard
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?
|
|

October 8th, 2009, 03:42 AM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

October 8th, 2009, 03:57 AM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|
 |