Home / Companies / Octopus Deploy / Blog / Post Details
Content Deep Dive

Escaping the pipe character in PowerShell commands

Blog post from Octopus Deploy

Post Details
Company
Date Published
Author
Matthew Casperson
Word Count
609
Language
English
Hacker News Points
-
Summary

Matthew Casperson discusses a challenge he faced while using the Azure CLI to create a web application with a runtime specification that included a pipe character, which resulted in an error message. To resolve this, he explores various solutions such as wrapping the string with single or escaped double quotes, and utilizing the PowerShell stop-parsing symbol (—%) to prevent PowerShell from interpreting the string. He notes that certain methods, like using single quotes alone, placing the string into a variable without quotes, or using PowerShell escape characters, do not work and may lead to errors. Casperson emphasizes that understanding the correct use of quotes and the stop-parsing symbol is essential for passing arguments with pipe characters in PowerShell.