MethodsAndPractices / vsteam

PowerShell module for accessing Azure DevOps Services and Azure DevOps Server (formerly VSTS or TFS)
https://methodsandpractices.github.io/vsteam-docs/
MIT License
442 stars 155 forks source link

Fix #493 import-module loses previously stored configuration #508

Closed mnieto closed 1 year ago

mnieto commented 1 year ago

PR Summary

This fix #493 issue

When the module is configured with Set-VSTeamAccount -Level user, the configuration is stored in env variables and then recovered next time while import-module vsteam The problem was introduced in commit https://github.com/MethodsAndPractices/vsteam/commit/0528c762bf9d1508a5cba76890c3323039d92fb8 (https://github.com/MethodsAndPractices/vsteam/issues/467 closed in https://github.com/MethodsAndPractices/vsteam/pull/480)

Also fixed a related problem with test ran in local: If the user calls Set-VSTeamAccount with -Local parameter, the TEAM_VERSION environment variable is preserved in the user's profile. The Versions.SetApiVersion did not manage the APIs.Version value and the test failed. This behaviour does not occur in during the GitHub build because the TEAM_VERSION variable is not set (it gets the default value).

PR Checklist

mnieto commented 1 year ago

@SebastianSchuetze , any chance to merge this PR?