Link to home
Start Free TrialLog in
Avatar of Neil Russell
Neil RussellFlag for United Kingdom of Great Britain and Northern Ireland

asked on

output Arrays with headers....

Hi,
hopefully a simple question with a simple answer....

I Initialise an array, No problems,
$Global:myData = @()

Open in new window


I have an array populated in a loop, no problems.
{

Open in new window


I add to the array in an inside loop, again no problems
$myUser = Get-QADUser $username | Select Name, Email
$Global:myData += $myUser

Open in new window


I output the array contents, no problem FIRST time through but read on....
}
$myData | Sort Name | Select Name, Email -Unique

Open in new window


I reinitialise the array and loop back to next itteration...
$Global:myData = @()
	}

Open in new window


Now on the FIRST run through the loop i get output with column names of Name and  Email nicely underlined with the array data below listed nicely. On subsequent iterations of the loop, no column headings show?

How do i force it to show these headers with eacho output of $myData?

Thanks
SOLUTION
Avatar of soostibi
soostibi
Flag of Hungary image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Neil Russell

ASKER

This is not a whole code listing, its the concept.  But easy enough to see the principal surely?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for tha