VMware Cloud Community
Travis_83
Enthusiast
Enthusiast
Jump to solution

VMView (Horizon 7) VDi Numbers per pool

hi guys,

found a script by lucd for this output but struggling to make it output to e-mail,

basically just a formatted table via email listing the pool name, number of virtual desktops per pool

email using smtp to whomever.

thanks,

travis

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You could do something like this.

It assumes that $table is an array with the data you want to send.

With the ConvertTo-Html you can go fancy and apply style sheets.

PS: I used splatting for the parameters

$sMail = @{

    To = 'me@domain.com'

    From = 'you@domain.com'

    Subject = 'Report'

    SmtpServer = 'smtp.domain.com'

    BodyAsHtml = $true

    Body = $table | ConvertTo-Html | Out-String

}

Send-MailMessage @sMail


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

1 Reply
LucD
Leadership
Leadership
Jump to solution

You could do something like this.

It assumes that $table is an array with the data you want to send.

With the ConvertTo-Html you can go fancy and apply style sheets.

PS: I used splatting for the parameters

$sMail = @{

    To = 'me@domain.com'

    From = 'you@domain.com'

    Subject = 'Report'

    SmtpServer = 'smtp.domain.com'

    BodyAsHtml = $true

    Body = $table | ConvertTo-Html | Out-String

}

Send-MailMessage @sMail


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference