-
Hi guys,
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Adding an if statement will solve the script issue: Import-Module -Name PSFalcon
Request-FalconToken -Cloud us-2 -ClientId ... -ClientSecret ...
$Duplicate = Find-FalconDuplicate
if ($Duplicate) {
$Timestamp = Get-Date -Format FileDate
$Duplicate | Export-Csv "$(Join-Path $env:SystemDrive ('duplicates',$Timestamp -join '_')).csv" -NoTypeInformation -Append
Invoke-FalconHostAction -Name hide_host -Id $Duplicate.device_id
} |
Beta Was this translation helpful? Give feedback.
-
@bk-cs Hi and thank you. I was able to figure out my root problem - my corporate firewall is blocking my API requests 🤡 so it didn't give me any warning messages. Please ignore this post entirely. Thank you for your help! |
Beta Was this translation helpful? Give feedback.
Find-FalconDuplicate
returns a warning message instead of standard output if no duplicates are found. Is that what you see if you try the command outside of your script? If you're only receiving the warning message, I would expect a blank CSV.Adding an if statement will solve the script issue: