Using Powershell in a Host Integrity script doesn't work
search cancel

Using Powershell in a Host Integrity script doesn't work

book

Article ID: 368300

calendar_today

Updated On:

Products

Endpoint Security Complete Endpoint Security Endpoint Security for Servers Endpoint Protection

Issue/Introduction

When trying to use the Utility: Run a script function in a Host Integrity(HI) policy, the Powershell script isn't executed but HI reports success.

Cause

-File parameter missing from "Execute the command*" field.

Resolution

When using a PowerShell script, in the "EXECUTE THE COMMAND*" field, it must be formatted like:

powershell -File %F%

The -File parameter is necessary for PowerShell to get the full file path and file name of the script.  %F% is the variable which points to the path + script file name.

Additionally, depending on the PowerShell Execution Policy set on the target system of the HI policy, PowerShell scripts may be blocked from running by the system configuration.  For more information about PowerShell Execution policies, visit the Microsoft documentation below.

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.4