What do I use for $instance in the Add-SqlMonitorAnnotation ?
scubakuba
Posts: 3 New member
Hi
I'm trying to make this query work, but it won't let me type in server name or instance name in the $instance variable.
What should I put in the $instance variable to make it work?
The manual says it should be a MonitoredObject value here, but what is that?
https://documentation.red-gate.com/sm/api/powershell-api/annotations
I'm trying to make this query work, but it won't let me type in server name or instance name in the $instance variable.
What should I put in the $instance variable to make it work?
The manual says it should be a MonitoredObject value here, but what is that?
https://documentation.red-gate.com/sm/api/powershell-api/annotations
Add-SqlMonitorAnnotation -Target $instance -Description "Deployment" -UtcDate Get-Date<br>
Best Answer
-
scubakuba Posts: 3 New memberFound a solution on how to add the proper value in $instance:
$instance = Get-SqlMonitorInstance -Name "insertthenamehere"
Add-SqlMonitorAnnotation -Target $instance -Description "Deployment" -UtcDate Get-Date