Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Obsolete message to Send-MailMessage #9178

Merged

Conversation

TravisEz13
Copy link
Member

@TravisEz13 TravisEz13 commented Mar 20, 2019

PR Summary

Add Obsolete message to Send-MailMessage

PR Context

See PowerShell/PowerShell-RFC#160

PR Checklist

@@ -14,6 +14,7 @@ namespace Microsoft.PowerShell.Commands
/// <summary>
/// Implementation for the Send-MailMessage command.
/// </summary>
[Obsolete("This cmdlet only supports sending mail from insecure SMTP servers. While there is no immediate replacement available in PowerShell, we recommend you do not use Send-MailMessage at this time.")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"from"? Maybe "insecure connect to"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pinged @joeyaiello who wrote the message

@TravisEz13 TravisEz13 marked this pull request as ready for review March 21, 2019 18:55
@@ -14,6 +14,7 @@ namespace Microsoft.PowerShell.Commands
/// <summary>
/// Implementation for the Send-MailMessage command.
/// </summary>
[Obsolete("This cmdlet only supports sending mail from insecure SMTP servers. While there is no immediate replacement available in PowerShell, we recommend you do not use Send-MailMessage at this time.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add test to validate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WarningVariables does not capture this warning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try using powershell.invoke and then check the streams.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a xUnit test suite for all public APIs to have API contract.


$null = $powershell.AddCommand("Send-MailMessage").AddParameters($InputObject).AddParameter("ErrorAction","SilentlyContinue")

#Send-MailMessage @InputObject -ErrorAction SilentlyContinue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this.

TravisEz13 and others added 2 commits March 22, 2019 10:18
…d-MailMessage.cs

Co-Authored-By: TravisEz13 <travis.plunk@microsoft.com>
…d-MailMessage.cs

Co-Authored-By: TravisEz13 <travis.plunk@microsoft.com>
@TravisEz13 TravisEz13 merged commit 94616f1 into PowerShell:master Mar 22, 2019
@TravisEz13 TravisEz13 deleted the marke_send_mailmessage_obsolete branch March 22, 2019 19:52
@TravisEz13 TravisEz13 added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Mar 22, 2019
@TravisEz13 TravisEz13 added this to the 6.2.0-GA-Consider milestone Mar 22, 2019
TravisEz13 added a commit that referenced this pull request Mar 25, 2019
Add Obsolete message to Send-MailMessage

## PR Context

See PowerShell/PowerShell-RFC#160

Co-authored-by: Steve Lee <slee@microsoft.com>
Co-authored-by: Ilya <darpa@yandex.ru>
# Conflicts:
#	test/powershell/Modules/Microsoft.PowerShell.Utility/Send-MailMessage.Tests.ps1
@TravisEz13 TravisEz13 modified the milestones: 6.2.0-GA-Consider, 6.2.0 Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants