Send-MailMessage: add parameter "ReplyTo"#8727
Conversation
|
@SteveL-MSFT Public API need approval by PowerShell Committee . |
|
@replicaJunction Thanks for your contribution! Please add tests (see Send-MailMessage.Tests.ps1 file). |
|
@iSazonov I may need help adding tests for this. I did test interactively, and the reply-to field was correctly populated in an e-mail message, but even the existing Pester tests won't run on my development box since they're hard-coded to run only on Linux. If I'm reading correctly, it looks like the existing tests actually call a mail server running on the local machine to send a message, and then they read the message back from disk. Could someone with easy access to a Linux device help with Pester tests? |
|
@replicaJunction You could create new test like existing in Send-MailMessage.Tests.ps1 and push the commit - then you'll see result in CI (click Detail link). |
|
I've added the -ReplyTo parameter to the existing tests, and it looks like they passed. Regarding the CodeFactor issue above, I wrote the line in question to match the style of the existing code in that switch block. I don't think that issue can be fixed without reformatting the entire block, and I didn't want to clutter up this PR with formatting changes to others' code. |
|
@SteveL-MSFT FYI. Waiting for PowerShell Committee to review this simple new public API. |
|
@PowerShell/powershell-committee reviewed this. It should be understood that cmdlets are not considered APIs, so adding a new parameter that is implemented as a public member does not require @PowerShell/powershell-committee review unless the reviewers of the PR believe it is controversial or can not come to a consensus. In this case, |
|
Exception for the CodeFactor issue seems reasonable. Merging,.. |
|
@replicaJunction Thanks for your contribution! |
PR Summary
Adds a
-ReplyToparameter to Send-MailMessage, which allows users to include the Reply-To field in their e-mail messages.PR Context
Fixes issue #8719.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.[feature]to your commit messages if the change is significant or affects feature tests