Server list is huge so i want to format or make it html this so it reads easy…..
$sessions = gc Servers.txt | New-PSSession
$block = {
$SystemUpTime = New-TimeSpan -Seconds (gwmi -Query "SELECT SystemUpTime FROM Win32_PerfFormattedData_PerfOS_System" | Select -ExpandProperty SystemUpTime)
"{0} Uptime: {1} Days {2} Hours" -f $ENV:COMPUTERNAME, $SystemUpTime.Days, $SystemUpTime.Hours}
$body = Invoke-Command -ScriptBlock $block -Session $sessions | out-string -stream
Send-MailMessage -SmtpServer "xxxx" -From "xxxx" -To "xxxx" -Subject "xxxx" -Body $body
can anyone help?