diff --git a/Dockerfile b/Dockerfile index ed219df..a661636 100644 --- a/Dockerfile +++ b/Dockerfile @@ -84,7 +84,7 @@ COPY container_files/sendtierbeacon.ps1 c:\\util #schedule script to run (at random time) #RUN powershell ($tm=((Get-Random -Minimum 0 -Maximum 4) -as [string]) + ":" + ((Get-Random -Minimum 0 -Maximum 60) -as [string]) ; start-process -filepath schtasks -passthru -wait -argumentlist '/create','/tn','\"Send TIER Beacon\"','/tr','c:\util\sendtierbeacon.ps1','/sc','DAILY','/st',"$tm" #The line above is triggering an apprent bug in docker or windows core (essentially invalid XML), the 2 lines below are the workaround -COPY container_files/TIER_Beacon_Task.xml c:\TIER_Beacon_Task.xml +COPY container_files/TIER_Beacon_Task.xml c:\\TIER_Beacon_Task.xml RUN powershell schtasks /Create /XML c:\TIER_Beacon_Task.xml /TN 'TIER Beacon' ; $tm=((Get-Random -Minimum 0 -Maximum 4) -as [string]).padleft(2,'0') + ':' + ((Get-Random -Minimum 0 -Maximum 60) -as [string]).padleft(2,'0') ; schtasks /Change /TN 'TIER Beacon' /ST $tm RUN del c:\TIER_Beacon_Task.xml