Add Obsolete message to Send-MailMessage (#9178)

Add Obsolete message to Send-MailMessage

## PR Context

See https://github.com/PowerShell/PowerShell-RFC/pull/160

Co-authored-by: Steve Lee <slee@microsoft.com>
Co-authored-by: Ilya <darpa@yandex.ru>
This commit is contained in:
authored and GitHub committed 2019-03-22 12:52:41 -07:00
1 parent f81f778308
commit 94616f1789
2 files changed
+11 -1

No files matched your search

@@ -78,7 +78,16 @@ Describe "Send-MailMessage" -Tags CI, RequireSudoOnUnix {
$server | Should -Not -Be $null
Send-MailMessage @InputObject -ErrorAction SilentlyContinue
$powershell = [PowerShell]::Create()
$null = $powershell.AddCommand("Send-MailMessage").AddParameters($InputObject).AddParameter("ErrorAction","SilentlyContinue")
$powershell.Invoke()
$warnings = $powershell.Streams.Warning
$warnings.count | Should -BeGreaterThan 0
$warnings[0].ToString() | Should -BeLike "The command 'Send-MailMessage' is obsolete. *"
$mail = Read-Mail