How to escape schtasks /tr arguments
问题 I need to schedule a PowerShell task like following: powershell.exe -file ..\Execute\execute.ps1 And I have tried assigning it to an argument $Argument then pass it to schtasks like following: $Argument = "powershell.exe -file '..\Execute\execute.ps1'" schtasks /create /tn "SOE_Checks" /tr $Argument /sc DAILY /st 05:00 /ru "System" /rl HIGHEST /f but after running above code, nothing happened - while the task is created successfully, it appears not to run. I have also tried assigning it to