[CmdletBinding()]
param ($computername = (Read-Host "Please state the problem you are having"),
$subject = "### Incoming Ticket From User: $env:USERNAME Computer: $env:COMPUTERNAME ###",
$to = "NCIT.Help@us.af.mil",
$bcc = '',
$body = $Collection,
[string]$ErrorLog = 'c:\powershell\useful\errorlog\retry.txt',
[switch]$LogErrors
)
[Array]$Collection = foreach($computer in $computername)
{
$body = New-Object -TypeName PSObject -Property @{
Problem = $computer;
} | format-list | out-string
#$obj | convertTo-csv | out-string
#$obj = $body
#$Collection = [string]$body
#[String]$Collection
[string]$body
Start-Process -FilePath "mailto:$to&subject=$subject&body=$body"
}
$Collection