{"id":25506598,"url":"https://github.com/kemyke/cake.tfs.build.variables","last_synced_at":"2026-03-08T11:31:27.485Z","repository":{"id":65397760,"uuid":"110471036","full_name":"Kemyke/Cake.Tfs.Build.Variables","owner":"Kemyke","description":"Retrieving TFS variable from arguments or environment variables.","archived":false,"fork":false,"pushed_at":"2022-11-11T16:13:40.000Z","size":1845,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-01T01:58:03.330Z","etag":null,"topics":["addin","cake","tfs","variables","vnext"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kemyke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-12T21:33:31.000Z","updated_at":"2022-11-11T16:08:02.000Z","dependencies_parsed_at":"2023-01-22T02:01:05.999Z","dependency_job_id":null,"html_url":"https://github.com/Kemyke/Cake.Tfs.Build.Variables","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kemyke/Cake.Tfs.Build.Variables","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kemyke%2FCake.Tfs.Build.Variables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kemyke%2FCake.Tfs.Build.Variables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kemyke%2FCake.Tfs.Build.Variables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kemyke%2FCake.Tfs.Build.Variables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kemyke","download_url":"https://codeload.github.com/Kemyke/Cake.Tfs.Build.Variables/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kemyke%2FCake.Tfs.Build.Variables/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270470061,"owners_count":24589280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addin","cake","tfs","variables","vnext"],"created_at":"2025-02-19T06:58:48.516Z","updated_at":"2026-03-08T11:31:27.480Z","avatar_url":"https://github.com/Kemyke.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cake.Tfs.Build.Variables\n\n## Summary\n\nRetrieving TFS variable from arguments or environment variables. \n\n## Usage\n\n```\n#addin \"nuget:?package=Cake.Tfs.Build.Variables\"\n\n\nvar testDbName = EvaluateTfsBuildVariable(\"TestDb.Name\");\nvar testDbConnectionString = EvaluateTfsBuildVariable(\"TestDb.ConnectionString\");\n```\n\n## Details\nThis namespace contain types used for evaluating TFS build variables by name. By default TFS expose its variables as environment variables. \nFirst they convert the name of the variable to be compatible with environment variables names. (eg. TestDb.Name -\u003e TESTDB_NAME)\n\nTFS doesn't resolve chained variables. This library recursively resolve chained variables and substitute all variables found in the value of other variables. \nFor example:\n\nTFS variables:\n```\nTestDb.ConnectionString = \"data source=(localDb)\\mssqllocaldb;initial catalog=$(TestDb.Name);integrated security=True;MultipleActiveResultSets=True;App=EntityFramework\"\nTestDb.Name \t\t\t= \"TestCatalog\"\n```\n\nBut the TFS converts this to environment variables like these:\n```\nTESTDB_CONNECTIONSTRING = \"data source=(localDb)\\mssqllocaldb;initial catalog=$(TestDb.Name);integrated security=True;MultipleActiveResultSets=True;App=EntityFramework\"\nTESTDB_NAME \t\t\t= \"TestCatalog\"\n```\n\nAs you can see TFS doesn't evaluate the environment variables like you expect. This library does the substitution and when you call `EvaluateTfsBuildVariable(\"TestDb.ConnectionString\"`\nyou will receive `\"data source=(localDb)\\mssqllocaldb;initial catalog=TestCatalog;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework\"`\n\n\nBefore retreiving environment variable this library try to retrieve an Cake Argument with the variable name. This is useful because you can override values by passing \nit to the Cake script. And it is also useful bacuse of the secret variables. TFS doesn't expose secret variables as environment variables. You must pass \nsecret variables as argument to the script from the TFS build step. If no argument and no environment variable found then a default value is returned \nif it is provided. If not an ArgumentException is thrown.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkemyke%2Fcake.tfs.build.variables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkemyke%2Fcake.tfs.build.variables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkemyke%2Fcake.tfs.build.variables/lists"}