EPM - Script Distribution Policy appending additional command when executing Powershell scripts

EPM - Script Distribution Policy appending additional command when executing Powershell scripts

83
Created On 11/10/26 10:55 AM - Last Modified 11/10/26 15:51 PM


Question


When the user attempts to execute a .ps1 on Script Distribution Policy.
EPM will execute the "powershell.exe" while appending the following command to run the script:
-Command if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass -Force}; 

Why did EPM Agent execute the script with the above command?



Environment


24.7;24.8;24.9;24.10;24.11;24.12;25.1;25.2;25.3;25.4;25.5 EPM EPM Agent

Answer


When the machine's Script Execution policy is set to "AllSigned", PowerShell requires that all scripts (including those deployed by EPM) must be digitally signed by a trusted publisher.
Next, when "AllSigned" is enforced as the script execution policy, PowerShell blocks any unsigned scripts from running — even if its triggered by EPM 

EPM’s Script Distribution Policies are designed to work under standard execution policies (e.g., "Bypass", "RemoteSigned", etc.), which is why EPM is appending the command when executing .ps1 script



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000000n7DCAQ&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail