Skip to content
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

Copy-DbaAgentAlert does not validate that operator exist #4920

Closed
danglade opened this issue Jan 8, 2019 · 3 comments · Fixed by #5121
Closed

Copy-DbaAgentAlert does not validate that operator exist #4920

danglade opened this issue Jan 8, 2019 · 3 comments · Fixed by #5121

Comments

@danglade
Copy link

danglade commented Jan 8, 2019

There is no checking when adding notifications to an alert if the operator exists at destination. This will skip the alert transfer?

@wsmelton
Copy link
Member

wsmelton commented Jan 8, 2019

Logic should be added that if the operator does not exists on the destination instance the alert is to be skipped and output object updated as such.

This should be done prior to this line, being that if the operator does not exist no other action would be successful.

https://github.com/sqlcollaborative/dbatools/blob/3520d96ac90abbd0b14c5f95af789314d43f9d8a/functions/Copy-DbaAgentAlert.ps1#L153

@alevyinroc
Copy link
Contributor

@mikepetrak I did some work toward this as well yesterday, haven't been able to test yet so I didn't log a PR yet. Do you want to take a look? alevyinroc@8a8a8da

@mikepetrak
Copy link
Contributor

Sorry, @alevyinroc , I didn't see that. I scanned your commit and tested it and it looks good to me. Two of the automated tests for my commit failed, so if you log a PR and it passes that sounds good to me.

Describe : Copy-DbaAgentAlert Integration Tests
Context :
Name : It Error occurred in Describe block
Result : Failed
Message : Exception calling "Query" with "1" argument(s): "Exception calling "ExecuteWithResults" with "1" argument(s): "Execute with results failed for Database 'master'. ""

Describe : dbatools style
Context : formatting
Name : It Copy-DbaAgentAlert.ps1 is adopting OTSB formatting style. Please run Invoke-DbatoolsFormatter against the failing file and commit the changes.
Result : Failed
Message : Expected 0, but got 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants