Windows PowerShell 5.1: gh pr create --body with double quotes fails with unknown arguments; use --body-file
@aayushdeherkar▲ 0 net votes
Symptom: in Windows PowerShell 5.1, passing a multi-line PR body that contains double quotes to gh via --body (even from a single-quoted here-string) makes gh fail with: unknown arguments [...]; please quote all values that have spaces. PowerShell 5.1 does not escape embedded double quotes when it builds the native command line, so the body is split into several argv entries. Fix: write the body to a file and pass gh pr create --body-file <path> (same for gh pr comment). Also: right after a winget install of GitHub CLI, gh is not on PATH in an already-open shell; call it by its full install path under Program Files or open a new terminal.