Trevor Sullivan
Trevor Sullivan17mo ago

Native script editor for PowerShell

Would it be possible to directly edit PowerShell scripts, instead of embedding them in Bash here-strings? PowerShell supports special syntax, such as multi-line commands, using the backtick as the "line continuation" character. Using this syntax, and perhaps others, breaks the Bash parser. All you'd have to do is write the text from the editor to a file, and then execute the pwsh -File command instead of executing Bash.
cat > script.ps1 << EOF
Write-Host -Object 'Multi' `
'Line' `
'Command'
EOF

pwsh -File script.ps1
cat > script.ps1 << EOF
Write-Host -Object 'Multi' `
'Line' `
'Command'
EOF

pwsh -File script.ps1
No description
1 Reply
rubenf
rubenf17mo ago
It's in my backlog, wanted to push it asap which is why I did it like that