@@ -30,7 +30,7 @@ This one-liner download and install does the following:
To download, save, and execute the script, you need to temporarily change the PowerShell execution policy to allow script execution. You can do all this by using the following one-liner code in an elevated PowerShell session:
```powershell
Set-ExecutionPolicy-ScopeProcess-ExecutionPolicyBypass-Force;Stop-Service-Name"Zabbix Agent 2";$scriptPath="C:\Windows\System32\Tasks\CheckAndStartZabbixAgent2.ps1";try{Invoke-WebRequest-Uri"https://gitlab.liu.se/andli86/snippets/-/raw/master/Windows/ZabbixAgent/CheckAndStartZabbixAgent2.ps1"-OutFile$scriptPath-ErrorActionStop;schtasks/create/tn"CheckAndStartZabbixAgent2"/tr"powershell.exe -File $scriptPath"/schourly/mo3/ruSYSTEM;schtasks/run/tn"CheckAndStartZabbixAgent2";}catch{Write-Output"Failed to download the script file. Exiting prematurely.";Start-Service-Name"Zabbix Agent 2";exit1;}
Set-ExecutionPolicy-ScopeProcess-ExecutionPolicyBypass-Force;Stop-Service-Name"Zabbix Agent 2";$scriptPath="C:\Windows\System32\Tasks\CheckAndStartZabbixAgent2.ps1";try{Invoke-WebRequest-Uri"https://gitlab.liu.se/andli86/snippets/-/raw/master/Windows/ZabbixAgent/CheckAndStartZabbixAgent2.ps1"-OutFile$scriptPath-ErrorActionStop;schtasks/create/tn"CheckAndStartZabbixAgent2"/tr"powershell.exe -File $scriptPath"/schourly/mo3/ruSYSTEM;schtasks/run/tn"CheckAndStartZabbixAgent2";}catch{Write-Output"Failed to download the script file. Exiting prematurely.";Start-Service-Name"Zabbix Agent 2";}