Companion to cli-tools.md and modern-tools.md. Those pick which tool; this picks which shell syntax to hand the user.
On this machine the user ALWAYS uses Windows PowerShell. Every command you give the user to run must be PowerShell-native — never bash — UNLESS the current work is inside WSL (a Linux shell), where bash is the default.
The user's PowerShell is Windows PowerShell 5.1: no &&/|| chaining, no export, no \ line-continuation,
no unix coreutils. Generate accordingly.
The user flagged this emphatically after being handed bash one-liners that errored on paste
(The token '&&' is not a valid statement separator in this version). Bash syntax in their terminal is pure
friction every time. They use PowerShell for everything except explicit WSL/Linux work.
| Don't give the user | Give instead |
|---|---|
export NAME=value |
$env:NAME = "value" |
cmd1 && cmd2 |
two separate lines (PS 5.1 has no &&). ; runs sequentially but does not stop on failure |
cmd1 \` continuation
| one line, or backtick ` continuation |
cd /x/Roam/BlockLab |
cd X:\Roam\BlockLab |
grep PAT file |
Select-String -Path file -Pattern 'PAT' |
jq '.x' f.json |
Get-Content f.json \| ConvertFrom-Json \| % { $_.x } |
cat / cut -d= -f2 |
Get-Content / .Split('=')[1] |
$(cmd) |
(cmd) (or $(cmd) works too, but (cmd) is idiomatic) |
VAR=x cmd (inline env) |
$env:VAR='x'; cmd |