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?
 
Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
$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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.