mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +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> # Conflicts: # test/powershell/Modules/Microsoft.PowerShell.Utility/Send-MailMessage.Tests.ps1
This commit is contained in:
@@ -115,7 +115,16 @@ Describe "Basic Send-MailMessage tests" -Tags CI {
|
||||
}
|
||||
|
||||
$user = [Environment]::UserName
|
||||
$inPassword = Select-String "^${user}:" /etc/passwd -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. *"
|
||||
if (-not $inPassword)
|
||||
{
|
||||
$PesterArgs["Pending"] = $true
|
||||
|
||||
Reference in New Issue
Block a user