[ BUG ] `Invoke-FalconDeploy` doesn't execute scripts specified in the `File` parameter
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.
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.
The fix listed above also resolves an unrelated issue where the run step is not executed when using Invoke-FalconDeploy on Mac hosts.
This fix was included in the 2.2.9 release. Closing issue now that the release is available.