Skip to content

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

Closed
@tomykaira

Description

@tomykaira
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions