1
0
Fork
You've already forked Windows
0
eduVPN test scripts
  • PowerShell 89.3%
  • Python 10.7%
2025年09月24日 09:27:02 +02:00
raspberry_pi_pico Update raspberry_pi_pico/wake_from_sleep.py 2025年09月24日 09:27:02 +02:00
WiFi WiFi monitor scripts from Chris/GertJan 2025年05月26日 11:45:46 +02:00
bug_report.md Mention that bug can occur when Wi-Fi roaming and that reason for indeterministic nature of bug is not yet known 2025年06月26日 14:05:00 +02:00
ping.ps1 simple ping with timestamp in powershell 2025年03月14日 13:55:36 +00:00
ping2.ps1 new ping with packtloss stats 2025年03月21日 16:13:49 +00:00
psshutdown.exe Rewrite sleep and check script to work with Pico script 2025年03月14日 15:13:34 +01:00
README.md Prerequisite added 2025年02月28日 09:55:08 +00:00
SleepAndCheckLoop.ps1 added print routing table before and after 2025年06月03日 11:51:05 +02:00

OpenAI generated scripts

Explanation of the wake-sleep-Script

Display-Error Function:

Utilizes Windows Forms to display a critical error message box if internet connectivity fails after waking up.

Check-Internet Function:

Uses Test-Connection to ping 8.8.8.8 four times. If the ping fails, it calls Display-Error and terminates the script. If the ping is successful, it outputs a message and continues the loop. Schedule-Wake Function:

Task Scheduling:

Creates a scheduled task named WakeAfter10Seconds. The task is scheduled to trigger once at the current time plus 10 seconds. The action is a no-operation PowerShell command (Exit), serving solely to wake the computer.

Wake Settings:

Configures the task to wake the computer if it's asleep. Allows the task to start even if the computer is on battery power.

Error Handling:

If scheduling fails (likely due to insufficient permissions), the script outputs an error message and exits. Sleep-ComputerNow Function: Puts the computer to sleep using rundll32.exe. Alternatively, you can use the Suspend-Computer cmdlet if available and desired.

Infinite Loop:

Continuously performs the scheduling, sleeping, waking, and checking steps. After the computer wakes up, the script waits for 5 seconds to ensure the system is fully operational before performing the internet connectivity check.

###Prerequisite PowerShell.exe -ExecutionPolicy Bypass -File .\SleepAndCheckLoop.ps1

##System Sleep Behavior: Ensure that your system's sleep settings allow wake timers. Verify Wake Timers: Go to Control Panel > Hardware and Sound > Power Options. Click on Change plan settings next to your active power plan. Click on Change advanced power settings. Expand Sleep > Allow wake timers. Set it to Enable for both On battery and Plugged in as needed.