With the release of the Database Performance Analyzer 12.1 and the Management API, I have started developing a PowerShell module called PSDPA. The module is now available through the PowerShell Gallery and GitHub. I would still consider this release a "beta" release, as not everything has been implemented and not everything has been tested. If you have ideas on additional features - feel free to submit a GitHub issue. Pull requests are also welcome!
Prerequisites
- PowerShell 5.x
- PSFramework PowerShell Module
- DPA 12.1 and an API Refresh Token
Installation
if (-not (Get-Module PSFramework -ListAvailable)) { Install-Module PSFramework }
Install-Module PSDPA
Configuration
Set-DpaConfig -BaseUri 'http://yourserver:8123/iwc/api' -RefreshToken 'yourrefreshtoken'
Links
Practical Examples
# add an annotation to all servers after patching
Get-DpaMonitor | Add-DpaAnnotation -Title "Patching" -Description "Operating system patching"
# reboot a server, but make sure to stop/start DPA on the instance before so we don't get alerts
Stop-DpaMonitor -MonitorName "MyServer"
Restart-Computer -ComputerName "MyServer"
Start-DpaMonitor -MonitorName "MyServer"