vscode-terminals icon indicating copy to clipboard operation
vscode-terminals copied to clipboard

How to run commands containing strings?

Open SurajMeena opened this issue 2 years ago • 1 comments

How can I run commands like Get-Process | Tee-Object - FilePath "results$((get-date).ToString("MM-dd-yyyy")) or for that matter functions with multiple lines? I couldn't find any example for usage of global env variables as well. Is it possible to add that in documentation?

SurajMeena avatar Jul 27 '22 17:07 SurajMeena

How can I run commands like Get-Process | Tee-Object - FilePath "results$((get-date).ToString("MM-dd-yyyy"))

I got answer to this part from the demo file that comes when you first run terminal: edit configuration. So we can use backslash to escape inverted commas. I am still curious how multiline commands can be written maybe backslash would work for them as well.

SurajMeena avatar Jul 27 '22 17:07 SurajMeena

I think perhaps if you want to write newlines you have to write the escape sequence for that: \n, which encoded inside JSON becomes: \\n.

fabiospampinato avatar Nov 15 '22 19:11 fabiospampinato