Question

When I run my script I get results that look like this

Computername                                          IPAddress                                             Date                                                
------------                                          ---------                                             ----                                                
testdns100                                            10.50.21.210                                          11/15/2013 14:00    

When I do a write-host or something similar, since I want to send the result out via email I get an output like this

@{Computername=testdns100; IPAddress=10.50.21.210; Date=11/15/2013 14:00}

Whats the best way for me to keep the output in the table format?

Was it helpful?

Solution

For email, the easist way I know is to run it through Format-Table, then Out-string:

$Body = $Objects | Format-Table | Out-String
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top