array contains another array. How to build an export in HTML ?.

I'm using the command with Pipe to build a table from a array. It's working perfectly.
Now, this array contains another array. How to build this ?.

The example comes from Exchange Rules management.
Here my code :
$ArrRules = get-inboxrule -mailbox $strMailboxAlias
$ArrRules|      Select-Object @{ Label = "Priority"; Expression = { $_.Priority} },
                    @{ Label = "Rule Name"; Expression = { $_.Name } },
                    @{ Label = "Activated"; Expression = { $_.Enabled }} |
      ConvertTo-HTML -Head $strHeader | Out-File $HtmlFile
--> generate as expected a html file.

Each of $arrRules contain another one which I need to export as well....
For ($nI = 0; $nI -le $ArrRules.Count - 1; $nI++)
{      Write-Host "`t`t`tProcessing $nI :$($ArrRules[$nI].Name)..."
      $arrRule = get-inboxrule $ArrRules[$nI].Name -mailbox $strMailboxAlias | select *
        ?????????????what statement to build an html table like with $arrRules?
}
On the $arrRule, I want the name and the description of each rule) and this on a table
François VDCIcT service DeskAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jose Gabriel Ortega CastroCEOCommented:
$ArrRules = get-inboxrule -mailbox $strMailboxAlias
$ArrRules|      Select-Object @{ Label = "Priority"; Expression = { $_.Priority} },
                    @{ Label = "Rule Name"; Expression = { $_.Name } },
                    @{ Label = "Activated"; Expression = { $_.Enabled }} |
      ConvertTo-HTML -Head $strHeader | Out-File $HtmlFile
--> generate as expected a html file.

Each of $arrRules contain another one which I need to export as well....
For ($nI = 0; $nI -le $ArrRules.Count - 1; $nI++)
{      Write-Host "`t`t`tProcessing $nI :$($ArrRules[$nI].Name)..."
      $arrRule = get-inboxrule $ArrRules[$nI].Name -mailbox $strMailboxAlias | select * 
      $arrRule | Convertto-html | out-file here.html
      
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
François VDCIcT service DeskAuthor Commented:
Gracias Jose !
but - I got only the last rule not all
only 2 fields need to be present from $arrrule. (name & description) - (I have manage this OK, select name, description)

but still only 1 rule out of the complete list... the html is always overwritten by the next record. (I have manage this OK, -append)

tks for your support !
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.