SAPIENScripter Posted December 14, 2006 Report Share Posted December 14, 2006 I was testing out Send-Mail and came across something I thought I'd share as a tip. If you are piping the output of a cmdlet straight to Send-Mail, you might not get the result you expect. If you run a command like get-process |Send-mail, the resulting mail message will look like this: Microsoft.PowerShell.Commands.Internal.Format.FormatStartDataMicrosoft.PowerShell.Commands.Internal.Format.GroupStartDataMicrosoft.PowerShell.Commands.Internal.Format.FormatEntryDataMicrosoft.PowerShell.Commands.Internal.Format.FormatEntryDataMicrosoft.PowerShell.Commands.Internal.Format.FormatEntryData You have to remember to pipe the output to Out-String and then to Send-mail get-process | Out-String | Send-Mail Unless Send-mail is tweaked so that any object passed to it is converted to a string so you don't have to think about it. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.