Fix the bench scripts on Windows PowerShell 5.1
setup_workstation.ps1 stopped on the failed import of a missing Python package instead of installing it; start_overnight.ps1 stopped on the keep-awake call, whose 0x80000001 literal is read as a negative int.
This commit is contained in:
@@ -29,7 +29,7 @@ function Run-Python([string[]]$a) { $rest = @(); if ($py.Count -gt 1) { $rest =
|
||||
|
||||
# Keep Windows awake for as long as this PowerShell process lives.
|
||||
Add-Type -Namespace Win -Name Power -MemberDefinition '[DllImport("kernel32.dll")] public static extern uint SetThreadExecutionState(uint f);'
|
||||
[void][Win.Power]::SetThreadExecutionState(0x80000001) # ES_CONTINUOUS | ES_SYSTEM_REQUIRED
|
||||
[void][Win.Power]::SetThreadExecutionState([uint32]2147483649) # 0x80000001 = ES_CONTINUOUS | ES_SYSTEM_REQUIRED (PowerShell 5.1 reads that literal as a negative int)
|
||||
|
||||
# Which board: the one Espressif native-USB port, unless named.
|
||||
if ($Port -eq "auto") {
|
||||
|
||||
Reference in New Issue
Block a user