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 - CTP Out-GridView

Reply
 
Old 11-24-2007   #1 (permalink)
Doug


 
 

CTP Out-GridView

How does the Out-GridView cmdlet know to display only a subset of fields (and
not all) with

ps | grid

Does it lookup up the parameter sets?

When inspecting the BaseObject or ImmediateBaseObject they have all the
available fields.

My System SpecsSystem Spec
Old 11-24-2007   #2 (permalink)


Vista Business x64
 
 

Re: CTP Out-GridView

CTP's Out-GridView does't support -Property yet. But there is a workaround -
Code:
ps | select -Property Id, ProcessName | grid
My System SpecsSystem Spec
Old 11-25-2007   #3 (permalink)
Doug


 
 

Re: CTP Out-GridView

Thanks.

Let me re-state.

I want to create a cmlet/snapin.

After creating a runspace etc and doing an invoke.

In Collection<PSObject> when looking at the base and immediateBase I see all
the properties returned.

How does the Out-GridView know to take the default ones and display just them?

"Matajon" wrote:
Quote:

>
> CTP's Out-GridView does't support -Property yet. But there is a
> workaround -
>
> Code:
> --------------------
> ps | select -Property Id, ProcessName | grid
> --------------------
>
>
> --
> Matajon
>
My System SpecsSystem Spec
Old 11-26-2007   #4 (permalink)
Marco Shaw [MVP]


 
 

Re: CTP Out-GridView

Doug wrote:
Quote:

> Thanks.
>
> Let me re-state.
>
> I want to create a cmlet/snapin.
>
> After creating a runspace etc and doing an invoke.
>
> In Collection<PSObject> when looking at the base and immediateBase I see all
> the properties returned.
>
> How does the Out-GridView know to take the default ones and display just them?
Actually, this has nothing to do with out-gridview. If you do just a
'ps', you'll see that output is the same as out-grid's.

This is ETS at its best:
http://msdn2.microsoft.com/en-us/library/ms714674.aspx

PSH> ps|get-member

TypeName: System.Diagnostics.Process
....

OK, so you're dealing with a System.Diagnostics.Process object.
PowerShell looks up "System.Diagnostics.Process" in this file to
determine what members to display by default:
C:\WINDOWS\system32\windowspowershell\v1.0\types.ps1xml

You can override this by editing the types.ps1xml (generally not a good
idea), or create your own .ps1xml file and either load it only when
needed or permanently via the profile (using update-typedata -prependpath).

Marco


--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
CTP3 Out-GridView PowerShell
Only 10 columns in out-gridview PowerShell
GridView Question .NET General
Gridview with more than 2 tables .NET General


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