Background job to refresh data on a form while script is running?

久未见 提交于 2019-12-01 21:30:01

Nice little utility.

I removed all references to the Job, and added the code from the job into the Tick itself:

$Timer.Add_Tick({
   $Status = GetStatus
   #LAN
   If ($Status.LANOnStatus -eq $True)
      {$Pb_LANOn.Image = $GreenLight}
   else
      {$Pb_LANOn.Image = $RedLight}
   ...
})

Since you mentioned the function took too much time, I also increased the Tick interval from 3 to 10 seconds. This seems to work fine on my PC.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!