Skip to content

Commit

Permalink
Use sc query to gain information about the service before attempting …
Browse files Browse the repository at this point in the history
…to stop it. (#15028)
  • Loading branch information
julien-lebot authored Jan 11, 2023
1 parent f2d278b commit caac8eb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

powershell_script 'stop-datadog-agent' do
code <<-EOH
Stop-Service -Force -Name "#{node['dd-agent-install']['agent_name']}"
sc.exe query "#{node['dd-agent-install']['agent_name']}"
sc.exe stop "#{node['dd-agent-install']['agent_name']}"
EOH
end

0 comments on commit caac8eb

Please sign in to comment.