CrowdStrike / falcon-scripts

Scripts to streamline the deployment and use of the CrowdStrike Falcon sensor
The Unlicense
130 stars 79 forks source link

fix(pwsh_uninstall): fixes bug with removehost due to non-string being passed when exception caught #269

Closed carlosmmatos closed 4 months ago

carlosmmatos commented 4 months ago

Fixes #268

The issue here was anytime an exception occurred when the API was called, the catch block was sending an Exception Object to the Write-VerboseLog, which didn't know how to handle that and would treat it as a JSON object, which would put it into an infinite loop. The fix was to ensure that we were sending in the $_.Exception.Message which is a string.