Only update/override powershell module path when in CI on module script import (#3791)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This commit is contained in:
Azure SDK Bot 2022-07-06 13:29:33 -07:00 committed by GitHub
parent 4a0e339563
commit b59bc3628b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
$DefaultPSRepositoryUrl = "https://www.powershellgallery.com/api/v2"
$global:CurrentUserModulePath = ""
function Update-PSModulePath()
function Update-PSModulePathForCI()
{
# Information on PSModulePath taken from docs
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_psmodulepath
@ -101,4 +101,6 @@ function Install-ModuleIfNotInstalled()
return $modules[0]
}
Update-PSModulePath
if ($null -ne $env:SYSTEM_TEAMPROJECTID) {
Update-PSModulePathForCI
}