Skip to content

Commit

Permalink
Swallow wpr cancel error in uninstallation path. (#3400)
Browse files Browse the repository at this point in the history
* Swallow wpr failure code in msi uninstall apth.

* override exit code

* wrap wpr cancel in process

---------

Co-authored-by: Igor Klemenski <[email protected]>
  • Loading branch information
rectified95 and Igor Klemenski authored Mar 27, 2024
1 parent 43b0373 commit 39874fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/install_ebpf.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -335,5 +335,8 @@ function Uninstall-eBPFComponents
Write-Log("MSI uninstallation completed successfully!") -ForegroundColor Green

# Stop KM tracing.
wpr.exe -cancel
$process = Start-Process -FilePath wpr.exe -ArgumentList "-cancel" -NoNewWindow -Wait -PassThru
if ($process.ExitCode -ne 0) {
Write-Log("Failed to stop WPR session with error: $($process.ExitCode)")
}
}

0 comments on commit 39874fb

Please sign in to comment.