Sunday, July 10, 2011

Unrecognized token in source text : powershell

While excecuting powershell script where you require charectors like @ , $ and * to be passed as parameters you can get following error .

Even IF you use a double quoted string will still need to use tic marks to escape the character.
(e.g. `@, `$ ).


Unrecognized token in source text.
At line:1 char:88
+ & 
...................................


-NoExit
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordEx
ception
+ FullyQualifiedErrorId : UnrecognizedToken