I have a very simple powershell script to notify newrelic when a deployment completes on a particular component. The problem I have is that I can't get the release number to be sent correctly.
The script I am using is:
$NewRelicUri = "https://api.newrelic.com/deployments.xml"
$body = @{
"deployment[app_name]" = "PB.Website";
"deployment[revision]"= "#{Octopus.Release.Number}";
}
Write-Host "Sending notification to $NewRelicUri..."
Invoke-WebRequest -Uri $NewRelicUri -Headers @{ "x-api-key"="XXX" } -Method Post -Body $body -UseBasicParsing
This produces a deployment in newrelic with the revision #{Octopus.Release.Number}. I have also tried using the long hand version of $OctopusParameters['Octopus.Release.Number'], but this produces a deployment with a revision of System.Collections.Generic.Dictionary``2[System.String,System.String]['Octopus.Release.Number']
How can I get octopus to put send the actual release number to newrelic?