Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running powershell task in TFS Build #520

Closed
naeemsarfraz opened this issue Sep 7, 2015 · 2 comments
Closed

Error running powershell task in TFS Build #520

naeemsarfraz opened this issue Sep 7, 2015 · 2 comments
Assignees

Comments

@naeemsarfraz
Copy link

I have a very simple script which spits out environment variables like this:

Write-Host "SYSTEM_TEAMPROJECT: $ENV:SYSTEM_TEAMPROJECT"

My build has one step, the PowerShell task. The task script filename is set to the path to the script in TFSVC e.g. $/Main/BuildProcessTemplates/AllProps.ps1.

When I queue a new build it fails reporting the following error: "The term 'C:\Builds\agent_work\cb535ea3\Main' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."

Have I configured the task incorrectly?

@bryanmacfarlane
Copy link
Contributor

Did you use the browse (... button) to get that path? Just want to make sure repo etc... is configured properly.

@naeemsarfraz
Copy link
Author

Tracked down the problem. I needed to include the repository location of the powershell script in the Mappings section of the Repository tab. Working fine now.

See http://stackoverflow.com/a/32453564/40986.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants