Skip to content

Instantly share code, notes, and snippets.

@giseongeom
Last active December 9, 2017 09:33
Show Gist options
  • Select an option

  • Save giseongeom/337902be0523ddbb7051ba59cfb84f3e to your computer and use it in GitHub Desktop.

Select an option

Save giseongeom/337902be0523ddbb7051ba59cfb84f3e to your computer and use it in GitHub Desktop.
Remove Datadog Agent for Windows prior to 5.12 forcefully
Stop-Service -Verbose -Force "DatadogAgent"
Start-Sleep 5
sc.exe delete DatadogAgent
Start-Sleep 5
Remove-Item -Recurse -Force 'C:\Program Files (x86)\Datadog\' 2>&1 | Out-Null
$ddlegacyregpath = (
Get-ChildItem HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall |
Where-Object { $_.ValueCount -gt 10 } |
Where-Object { (Get-ItemPropertyValue $_.PSpath -Name DisplayName) -match "Datadog Agent" } |
Select-Object -ExpandProperty PsChildName
)
Set-Location HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall
Remove-Item -Verbose -Force $ddlegacyregpath
Set-Location $HOME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment