psfalcon icon indicating copy to clipboard operation
psfalcon copied to clipboard

[ BUG ] `Invoke-FalconDeploy` doesn't execute scripts specified in the `File` parameter

Open bk-cs opened this issue 1 year ago • 2 comments

Describe the bug When using File with a PowerShell script (for Windows) or ZSH script (for Mac), the script is not started.

To Reproduce Invoke-FalconDeploy -File .\my.ps1 -HostId <id>

Expected behavior Script should be executed.

Environment (please complete the following information):

  • OS: Windows 10
  • PowerShell: 5.1
  • PSFalcon: 2.2.8

Additional context If you put the script in an archive and use Archive and Run instead, it works as expected.

bk-cs avatar Jan 06 '25 23:01 bk-cs

I've made changes to Invoke-FalconDeploy to fix this issue for the next release. If you'd like to resolve it for your local module before release, you can replace public\psf-real-time-response.ps1 using the steps outlined below.

Import-Module -Name PSFalcon
$ModulePath = (Show-FalconModule).ModulePath
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/CrowdStrike/psfalcon/refs/heads/dev/public/psf-real-time-response.ps1 -UseBasicParsing).Content > (Join-Path (Join-Path $ModulePath public) psf-real-time-response.ps1)

Please ensure you close and re-open PowerShell and re-import PSFalcon before testing. If you have any issues, respond here for me to review.

EDIT: Updated link with additional fix to account for when the put step fails more accurately.

bk-cs avatar Jan 07 '25 23:01 bk-cs

The fix listed above also resolves an unrelated issue where the run step is not executed when using Invoke-FalconDeploy on Mac hosts.

bk-cs avatar May 20 '25 16:05 bk-cs

This fix was included in the 2.2.9 release. Closing issue now that the release is available.

bk-cs avatar Sep 13 '25 01:09 bk-cs