You could do something like this
$fileName = '.\report.csv'
Get-VM | Get-Snapshot |
Select-Object -Property @{N = 'VM'; E = { $_.VM.Name } }, Name, Created,
@{N = 'SizeGB'; E = { [math]::Round($_.SizeGB, 1) } } |
Export-Csv -Path $fileName -NoTypeInformation -UseCulture
$sMail = @{
To = 'user@domain'
From = 'user@domain'
Subject = 'Snapshot Report'
SmtpServer = 'mail.domain'
Attachments = $fileName
}
Send-MailMessage @sMail