Last active
December 9, 2017 09:33
-
-
Save giseongeom/337902be0523ddbb7051ba59cfb84f3e to your computer and use it in GitHub Desktop.
Remove Datadog Agent for Windows prior to 5.12 forcefully
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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