From 74b48a24776a2d1395ec542d04cd3b29ef2a8e7a Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Fri, 12 Jan 2024 05:35:01 +0100 Subject: [PATCH] fix: run as Administratoren to prevent window --- templates/service_info.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/service_info.html b/templates/service_info.html index abd7b4b..8f21241 100644 --- a/templates/service_info.html +++ b/templates/service_info.html @@ -129,7 +129,7 @@ Invoke-RestMethod -TimeoutSec 2 -Uri "{{ flask.request.url_root.replace("http://", "https://" )}}report" -Method Post -Headers @{"Content-Type"="application/json"} -Body $SMART -
Windows (as hourly task)
+
Windows Task (requires Admin-Powershell)
$ScriptPath = Join-Path $HOME -ChildPath "smart_monitor.ps1"
echo '$SMART = @{
@@ -141,7 +141,7 @@
} | ConvertTo-Json

Invoke-RestMethod -TimeoutSec 2 -Uri "{{ flask.request.url_root.replace("http://", "https://" )}}report" -Method Post -Headers @{"Content-Type"="application/json"} -Body $SMART' > $ScriptPath
- schtasks /create /tn SMART_Monitor /tr "powershell.exe -executionpolicy bypass -File '$ScriptPath'" /sc hourly /mo 1
+ schtasks /create /tn SMART_Monitor /tr "powershell.exe -executionpolicy bypass -File '$ScriptPath'" /sc hourly /mo 1 /ru "Administratoren"
echo "Done"
{% else %}