diff --git a/Windows_10/run_all.ps1 b/Windows_10/run_all.ps1 index 4d7737698..2d8ea5f17 100644 --- a/Windows_10/run_all.ps1 +++ b/Windows_10/run_all.ps1 @@ -1,6 +1,8 @@ # TODO test Set-PSDebug -Trace 1 + +# TODO set to break on errors #TODO - add gh auth login # Scripts requiring user input @@ -10,6 +12,6 @@ Set-PSDebug -Trace 1 . $PSScriptRoot/packages_install.ps1 # ./optional_packages__install.ps1 . $PSScriptRoot/configs_install.ps1 -. $PSScriptRoot/manual_packages_install.ps1 +. $PSScriptRoot/source_packages_install.ps1 Set-PSDebug -Trace 0 diff --git a/Windows_10/manual_packages_install.ps1 b/Windows_10/source_packages_install.ps1 similarity index 53% rename from Windows_10/manual_packages_install.ps1 rename to Windows_10/source_packages_install.ps1 index 9a30367c6..27b19fd50 100644 --- a/Windows_10/manual_packages_install.ps1 +++ b/Windows_10/source_packages_install.ps1 @@ -23,15 +23,17 @@ $config = @" echo $config | Out-File -Encoding ASCII -FilePath ./dist/config.json -$exe_dir = "$PWD\dist" - -# TODO - make scheduler registration idempotent -$action = New-ScheduledTaskAction -Execute "$exe_dir\scroll-desktops.exe" ` - -Argument "--nowindowed --noconsole" ` - -WorkingDirectory "$exe_dir" -$trigger = New-ScheduledTaskTrigger -AtLogOn -Register-ScheduledTask -TaskName 'Taskbar_scroll' ` - -Action $action -Trigger $trigger -RunLevel Highest +( $res = Get-ScheduledTask "Taskbar_scroll" ) 2> $null +if ($res -eq $null) { + $exe_dir = "$PWD\dist" + $action = New-ScheduledTaskAction -Execute "$exe_dir\scroll-desktops.exe" ` + -Argument "--nowindowed --noconsole" ` + -WorkingDirectory "$exe_dir" + $trigger = New-ScheduledTaskTrigger -AtLogOn + + Register-ScheduledTask -TaskName 'Taskbar_scroll' ` + -Action $action -Trigger $trigger -RunLevel Highest +} popd