Skip to content

Install-DbaAgentAdminAlert / New-DbaAgentAlert - Bug when creating new operatorΒ #9756

@andreasjordan

Description

@andreasjordan

Verified issue does not already exist?

No, I did not search

What error did you receive?

The bug is shown when running the test Install-DbaAgentAdminAlert.Tests.ps1 as where is this waring:

Error adding notification of type NotifyEmail for Test Operator to CLIENT\SQLInstance2 | The specified @operator_name ('Test Operator') does not exist.

Looking at the code I don't see the bug. But maybe the SMO is not updated after creating the operator.

There are other issues with Install-DbaAgentAdminAlert:

$PSItem in line 169 is wrong, same for line 197.

New-DbaAgentAlert is called without EnableException.

Will try to work on that...

Steps to Reproduce

# provide your command(s) executed pertaining to dbatools
# please include variable values (redacted or fake if needed) for reference

Please confirm that you are running the most recent version of dbatools

Other details or mentions

No response

What PowerShell host was used when producing this error

PowerShell Core (pwsh.exe)

PowerShell Host Version

SQL Server Edition and Build number

.NET Framework Version

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions