PowerShell script execution policy configuration¶
PowerShell script execution policy is a security mechanism that determines whether scripts can run on a Windows system.^[600-developer__operation-maintenance__zabbix__zabbix-key.md]
Default Error¶
If a script is executed on a system where the execution is restricted, Windows will prevent the script from loading and report an error message stating "檔案無法載入,因為這個系統已停用指令碼執行" (File cannot be loaded because script execution is disabled on this system).^[600-developer__operation-maintenance__zabbix__zabbix-key.md]
Configuration Command¶
To enable script execution, the system policy must be modified. This requires opening PowerShell with Administrator privileges and running the following command:
Set-ExecutionPolicy RemoteSigned
This configuration allows the execution of scripts, resolving the loading error.^[600-developer__operation-maintenance__zabbix__zabbix-key.md]
Sources¶
600-developer__operation-maintenance__zabbix__zabbix-key.md