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:
parent
4a0e339563
commit
b59bc3628b
@ -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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user