I am using TeamCity 9 Professional and am trying to execute a powershell script in one of my build steps. Everything happens correctly (copying some files to a network location using xcopy) until the last action which involves an argument (directory path) passed in from TeamCity. The script works correctly when manually run but when TC runs it, it throws a "Parse Error" when it is supposed to use the argument.
The argument itself is correctly parsed by the PoSH script, it prints out correctly in the build log. The only difference between the line that fails and two other xcopy executions that don't is the input argument.
Does anyone have an idea about what might be wrong?