mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
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:
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
|
||||
|
||||
|
||||
Reference in new issue
Block a user