Filed under: Industry Insights
Today, we’re pleased to offer Windows users the same easy way to add those annotations. And, since everything to do with managing Windows hosts is now done through PowerShell, that’s what we’re going to use, too!
The cmdlet, called Publish-TraceViewMessage, is available from http://files.appneta.com/windows/Publish-TraceViewMessage.ps1 and the one script file contains all you need. Because it’s driven through our API, it uses the Invoke-RestMethod command which was introduced in PowerShell v3 in 2012. Server 2012 and Windows 8 users have this already, Windows 2008 and Win7 users will need to grab the free update from Microsoft.
To publish an annotation, use your access key that you used to install – it’s on the Settings -> Overview page of your TraceView console.
Publish-TraceViewMessage.ps1 -ClientKey:xxxx-xxx-xxx-xxx -Message “This is my annotation”
And that’s all you need. The annotation will be placed on the graph on your Default app as of the current time.
If you want to annotate another application, use the -Application switch, or the TimeStamp one if you want to backdate the annotation to a historical event. (TimeStamp will accept any date format that Get-Date understands. Though, as always, ISO 8601 date formats are best to avoid confusion.)
As with all good PowerShell, you have recourse to the Get-Help cmdlet to find out more, and the standard -Verbose switch is there if you need to troubleshoot.