powershell – Delay network disconnection with Task Scheduler

I have developed a Powershell script to set my location in Skype for Business based on subnet of the network I am connected to. This is successfully running in a Windows Task Schedule upon connection of any network (Log: Microsoft-Windows-NetworkProfile/Operational Source: Microsoft-Windows-NetworkProfile Event ID: 10000)

If the network drops, or I sleep/hibernate/restart/or shutdown the PC, another Task Schedule runs (same Log and Source, but with ID: 10001) with different arguments to clear the last location, but by the time it runs, the connection Skype for Business needs to publish my clearing of location is gone.

Is there a way with Task Scheduler to halt the disconnection of the network connection?