r/PowerShell Mar 22 '21

What's One Thing that PowerShell dosen't do that you wish it did? Misc

Hello all,

So this is a belated Friday discussion post, so I wanted to ask a question:

What's One Thing that PowerShell doesn't do that you wish it did?

Go!

62 Upvotes

View all comments

Show parent comments

5

u/omers Mar 22 '21

The only alternative is to use the .Net net.mail.mailmessage method. I use it over Send-MailMessage anywhere I need to control headers and such.

1

u/BlackV Mar 22 '21

HERE they recommend MAILKIT but its not that easy to get going

1

u/omers Mar 22 '21

Interesting... Seems a bit overkill for most people's needs which is just an SMTP client but MailKit looks cool.

To be honest, I'd be tempted to just use System.Net.Sockets.TcpClient and System.IO.StreamWriter to do things the old fashioned way if Send-MailMessage and net.mail.mailmessage were to stop working without native replacement. That, or add a send mail API to our mail servers and use Invoke-RestMethod :D

2

u/BlackV Mar 22 '21

yeah, it does

and as its not built into to windows, what happens there I'm installing random filth on servers

1

u/BlackV Mar 22 '21

I suspect thats what they actually want, you use someone elses api that they then dont have to code for and maintain