Hi I am trying to run the "tf get" command through powershell but i always get a unexpected token error when it reaches the arugments.
I was following the instructions from this post TFS commands in PowerShell script
the line where the error is happening is
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tf.exe" @("get", $args[$i])
where $args[$i] is an argument being entered by the user, but the script stops executing after calling the tf.exe
Could someone help me out here? Thanks.
You can't execute a command in a string without using the call operator e.g.
&
. In PowerShell a string evaluates to a string e.g.:You have to tell PowerShell that the string contains the name of a command using the call operator.
Note: when using
&
the string must contain just the name of the command. Arguments should be specified separately.