OpenShift jsonpath fails in Windows PowerShell due to error parsing template

Solution Verified - Updated -

Issue

oc commands with jsonpath specified fail in Windows PowerShell but run fine in Bash:

C:\> oc get pod -o go-template='{{range .items}}{{.metadata.name}}{{"\/n"}}{{end}}'
error: error parsing template {{range .items}}{{.metadata.name}}{{\/n}}{{end}}, template: output:1: unexpected "\\" in command

Environment

  • Red Hat OpenShift Container Platform
    • 3.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content