-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Add Obsolete message to Send-MailMessage #9178
Conversation
@@ -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.")] |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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
@@ -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.")] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs
Outdated
Show resolved
Hide resolved
|
||
$null = $powershell.AddCommand("Send-MailMessage").AddParameters($InputObject).AddParameter("ErrorAction","SilentlyContinue") | ||
|
||
#Send-MailMessage @InputObject -ErrorAction SilentlyContinue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this.
…d-MailMessage.cs Co-Authored-By: TravisEz13 <travis.plunk@microsoft.com>
src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs
Outdated
Show resolved
Hide resolved
…d-MailMessage.cs Co-Authored-By: TravisEz13 <travis.plunk@microsoft.com>
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
PR Summary
Add Obsolete message to Send-MailMessage
PR Context
See PowerShell/PowerShell-RFC#160
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while 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