From e36defaab2742b364155d7aa3a1ef6fa6e2e5a14 Mon Sep 17 00:00:00 2001 From: markocoha <101259528+markocoha@users.noreply.github.com> Date: Mon, 25 Aug 2025 16:25:59 +0200 Subject: [PATCH] Create Postgres_anotate --- Postgres_anotate | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Postgres_anotate diff --git a/Postgres_anotate b/Postgres_anotate new file mode 100644 index 0000000..92406a8 --- /dev/null +++ b/Postgres_anotate @@ -0,0 +1,24 @@ +This is an example how to Anotate a postgres server on Redgate monitor . + +Anotate the Postgres server : Save as script + + +# ----------------------------------------------- +# AddPostgresAnnotation.ps1 +# Adds a "Deployment" annotation to a Postgres instance in Redgate Monitor +# ----------------------------------------------- + +# Set the alias of the Postgres instance you want to annotate, In my example the machine Alias is Postgres +$PostgresAlias = "Postgres" + +# Get the monitored Postgres instance by Alias +$Instance = Get-RedgateMonitorMonitoredObject -Type PostgresInstance | Where-Object { $_.Alias -eq $PostgresAlias } + +# Check if the instance was found +if ($Instance) { + # Add annotation with current UTC timestamp + Add-RedgateMonitorAnnotation -Target $Instance -Description "Deployment made" -UtcDate ([datetime]::UtcNow) + Write-Output "Annotation added to instance '$PostgresAlias'." +} else { + Write-Output "Postgres instance with Alias '$PostgresAlias' not found." +}