Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 223568

Re: Powershell/PowerCLI Dynamic Email Message Body with Datastores

$
0
0

What do yo mean by "format it" ?

You just have to  add object memebrs in $output var and you'll have ohter column ....

 

It worked for me with these function and $style variable...

 

function Set-AlternatingCSSClasses {

    [CmdletBinding()]

    param(

        [Parameter(Mandatory=$True,ValueFromPipeline=$True)]

        [string]$HTMLFragment,

       

        [Parameter(Mandatory=$True)]

        [string]$CSSEvenClass,

       

        [Parameter(Mandatory=$True)]

        [string]$CssOddClass

    )

    [xml]$xml = $HTMLFragment

    $table = $xml.SelectSingleNode('table')

    $classname = $CSSOddClass

    foreach ($tr in $table.tr) {

        if ($classname -eq $CSSEvenClass) {

            $classname = $CssOddClass

        } else {

            $classname = $CSSEvenClass

        }

        $class = $xml.CreateAttribute('class')

        $class.value = $classname

        $tr.attributes.append($class) | Out-null

    }

    $xml.innerxml | out-string

}

 

 

 

 

$style = @"

<style>

body {

    color:#333333;

    font-family:Calibri,Tahoma;

    font-size: 10pt;

}

h1 {

    text-align:center;

}

h2 {

    border-top:1px solid #666666;

}

 

 

th {

    font-weight:bold;

    color:#eeeeee;

    background-color:#333333;

}

.odd  { background-color:#ffffff; }

.even { background-color:#dddddd; }

</style>

"@


Viewing all articles
Browse latest Browse all 223568

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>