View Single Post
Old 11-07-2007   #2 (permalink)
Marco Shaw [MVP]


 
 

Re: Running powershell via exchange 2007

Quote:

> [MSH] C:\Documents and Settings\admin>$pwd\test.ps1
> Unexpected token '\test.ps1' in expression or statement.
> At line:1 char:13
> + $pwd\test.ps1 <<<<
>
>
> Can anyone tell me why this is not working.
PowerShell is not dealing with the backslash properly. Run it like this:

PSH> & "$pwd\test.ps1"

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec