What is the best way to modify this report in order to send it as a csv and an html attachment using an smtp server?
Get-VIEvent -MaxSamples ([int]::MaxValue) -Start $start -Finish $finish |
Where-Object {"VmCreatedEvent","VmClonedEvent","VmDeployedEvent" -contains $_.Gettype().Name} | %{
$evtThisNewVMEvent = $_
Get-VM -Id $_.Vm.VM |
Select @{N="VM Name";E={$_.name}},
@{N="Memory (GB)";E={$_.MemoryGB}},
@{N="Created Time";E={$evtThisNewVMEvent.createdTime}}
} | export-csv -path "c:\vmscreated.csv" -NoTypeInformation
You can use something similar as in Re: Emailing results of a PowerCLI report
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can use something similar as in Re: Emailing results of a PowerCLI report
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks - it did work using that format.