'Task scheduler- create task with one-line powershell command
Is it possible to execute this task (command with CRLF) without error using the Task scheduler? `
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command &{(Get-Content -Path C:\tests\test.txt) -replace ('aaa=0',"aaa=20 `r`ng=11111 `r`ng=2222") | Set-Content -Path C:\tests\test.txt}
Powershell Command without error
(Get-Content -Path C:\tests\test.txt) -replace ('aaa=0',"aaa=20 `r`ng=11111 `r`ng=2222") | Set-Content -Path C:\tests\test.txt
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

