no-misleading-backtick
What it does
Section titled “What it does”Reports a backtick that is followed by blanks before the end of the line.
Why it matters
Section titled “Why it matters”The backtick continues a line only when it is the last character. With a space after it, the backtick escapes the space, the line is not continued, and the next line runs as a separate command. The space is invisible in an editor.
To fix, remove the blanks after the backtick, or avoid the backtick with splatting or a bracketed expression.
Example
Section titled “Example”Get-ChildItem ` -Force ` -Name$x = 1 + ` 2Configuration
Section titled “Configuration”powershell: lint: rules: no-misleading-backtick: warn # off, warn (default), errorSuppress one line with sudsy-disable-next-line no-misleading-backtick in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| psscriptanalyzer | PSMisleadingBacktick |
full |