I find that I frequently want to see the members of objects I am working with, and prefer to do this in a GridView. If, however, there are objects of different types in the collection there can be issues.  When simply  sending the collection to Get-Member there are separate results for each object type, but when then piping this to Out-GridView the member collections get merged in to one GridView.

To get around this I wrote my own cmdlet Out-MemberToGridView which launches a new GridView for each object type in the collection.

function Out-MemberToGridView{[CmdletBinding()]Param([parameter(ValueFromPipeline=$true)][Object]$inputObject,[string]$Title,[Switch]$Wait)

Begin{[String]$objectTypes = @()}Process{$objectTypeName = $PSItem.GetType().FullNameif (-not ($objectTypes.Contains($objectTypeName))){$objectTypes += $objectTypeNameif ([String]::IsNullOrEmpty($Title)){$GridTitle = $objectTypeName}else{$GridTitle = $Title}$PSItem | Get-Member | Out-GridView -Title $GridTitle -Wait:$Wait}}End{}}



Feature Articles


Blog
2024-2025 Government Budget: Focusing investment in cyber security skilling
By Jeremy Daly | 1 July 2024
Blog
The Growing Importance of Management Skills and the AMA CPM Certification in 2024
By Gary Duffield | 29 July 2024
Blog
The ASD’s Essential Eight: How to Implement Cyber Security Strategies with Training
By Leif Pedersen | 14 October 2024
Blog
5 Common RPL Challenges and How to Overcome Them
By Shanil Sharma | 15 August 2024
Blog
Transforming Your Business and Workforce with Microsoft AI Training
By Leif Pedersen | 30 July 2024
Blog
Security maturity is not a technical-only problem - invest in your people
By Jeremy Daly | 11 November 2024