Endpoint Security Complete

 Host Integrity - Utility Run a Script Function

Scott MacDonald's profile image
Scott MacDonald posted Jun 04, 2025 12:09 PM

Hello, I am attempting to use the Host Integrity - Utility: Run a Script Function, but I don't seem to be able to get the exact correct syntax for the "Execute the command" section.  My script is PowerShell, and I get it uploaded using the "File Name" section, which then populates the "Script Content" section with the code in the script...so far, so good.

I do need to be able to bypass our internal restriction of running PowerShell scripts, so I have this in the "Execute command" section:
powershell.exe -executionpolicy bypass -windowstyle hidden -noninteractive -nologo

Past that part of the command, I am unsure how the rest of that command should be entered to then run the script.  I have tried various versions of the command, but none of them are giving the same results as I get from using the similar "Utility: Run a program" function, with this command:
powershell.exe -executionpolicy bypass -windowstyle hidden -noninteractive -nologo -file "C:\temp\scriptname.ps1"

Some of the commands I have tried for the "Utility: Run a Script Function" are (noting I am using the %F% parameter for some of these, based on the "Use %F% to specify the script file name" text in the "Execute the command" field:
powershell.exe -executionpolicy bypass -windowstyle hidden -noninteractive -nologo
powershell.exe -executionpolicy bypass -windowstyle hidden -noninteractive -nologo %F%
powershell.exe -executionpolicy bypass -windowstyle hidden -noninteractive -nologo %scriptname.ps1%
powershell.exe -executionpolicy bypass -windowstyle hidden -noninteractive -nologo %F% "scriptname.ps1"

So my main request is for anyone that has successfully accomplished this, and the exact syntax they used for the "Execute the command" field when using a PowerShell script and that includes the "-executionpolicy bypass" parameter.

Thanks in advance to anyone who can help!