powershell syntax error

Dead_Eyes
Dead_Eyes used Ask the Experts™
on
I am having issues with a script sent to me by a friend (think it is becasue it was written in powershell v1)
the error is:

The '<' operator is reserved for future use.
At F:\test.ps1:159 char:13
+ "Press the < <<<< < space >> bar to start playing."
    + CategoryInfo          : ParserError: (<:OperatorToken) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : RedirectionNotSupported

The Code is:
"Press the << space >> bar to start playing."
Thanks in advance
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
With reserved characters, you have to escape them using a back tick. I don't think < requires it usually, but try adding a ` before each <. e.g.

"Press the `<`< space >> bar to start playing."


See if that makes a difference.

Author

Commented:
Still the same error :(
The '<' operator is reserved for future use.
At F:\pig.ps1:159 char:16
+ "Press the '<'< <<<<  space >> bar to start playing."
    + CategoryInfo          : ParserError: (<:OperatorToken) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : RedirectionNotSupported
I think you've used the wrong key. the back tick is at the top right of the keyboard, usually its the same key as ¬. the character you want will slant back a bit like so.  `

You might have to put it by all the < and > symbols, as > and >> can be used to redirect output.

Author

Commented:
My bad you are right :(. thanks

Commented:
You could also try using a single quote marks to delimit the string rather than double quotes,

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial