Skip to content

Instantly share code, notes, and snippets.

@ryanvgates
Created March 11, 2022 15:17
Show Gist options
  • Save ryanvgates/e15a8cf9411d0cffa2803e9a90a43ea0 to your computer and use it in GitHub Desktop.
Save ryanvgates/e15a8cf9411d0cffa2803e9a90a43ea0 to your computer and use it in GitHub Desktop.
Sensu Procdump Check Hook - PowerShell
Get-Location
$scriptPath = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
cd $scriptPath
Get-Location
$main_pid=C:\Windows\system32\inetsrv\appcmd.exe list wps /apppool.name:"mysite" /text:WP.NAME
if (Get-Process procdump -ErrorAction SilentlyContinue) {
Write-Output "Exiting since procdump is running."
exit
}
C:\procdump\procdump.exe -ma $main_pid -accepteula >> log-procdump.txt | Out-Null
iisreset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment