Search code examples
powershelltfscontinuous-integrationnugettfs-2015

TFS 2015 Build step Nuget Publisher "Ambiguous option 's'"


OK, so we're stuck on on-site TFS2015 at the moment. My Nuget Publisher build step is failing with:

##[error]Ambiguous option 's'. Possible values: Source SymbolSource SymbolApiKey.

##[error]Ambiguous option 's'. Possible values: Source SymbolSource SymbolApiKey.

It appears inside the build step they have put -s instead of -source, and in later versions they've added more commands starting with s. So what are my options?

  1. Write my own in Powershell (Can do, but TFS Build is very clunky for this)
  2. Find wherever this is defined in TFS (hopefully a template .ps file) and fix it there (Anyone know where this is kept?)
  3. Upgrade to a later version of TFS (a fairly large, but perhaps inevitable undertaking)
  4. Somehow override the -s command another way?
  5. ????????

Solution

    1. Invoke NuGet.exe however you'd like via the Command Line task

    If you did #3 (upgrade TFS), you'd find that the PowerShell build task can run an in-line PowerShell script, making it significantly less clunky.

    You may be able to extract and modify the task with the tfx command line utility, but I can almost guarantee this will have nasty ramifications when you do eventually upgrade.