nullpo-head / wsl-distrod

Distrod is a meta-distro for WSL 2 which installs Ubuntu, Arch, Debian, Gentoo, etc. with systemd in a minute for you. Distrod also has built-in auto-start feature on Windows startup and port forwarding ability.
MIT License
1.9k stars 91 forks source link

schedule_autostart_task.ps1 regex does not work when PS language is JA #4

Closed tomykaira closed 2 years ago

tomykaira commented 2 years ago
If ([bool](schtasks /query /fo list | Select-String -pattern "TaskName:\s+\\{{TASK_NAME}}" -quiet)) {

This part requires the system language is English, because the regex has TaskName literal. However, when OS language settings is Japanese, the schtasks command puts something like this:

タスク名:        \StartWSL_Ubuntu_for_desktop-xxxxxx-tomyk

How about just removing TaskName: because \s+\\{{TASK_NAME}} is enough to identify the newly registered task?

nullpo-head commented 2 years ago

Thanks for the catch! I'll fix it today later. It also would be very helpful if you could send your local change as a PR.