@@ -352,18 +352,29 @@ if (!$Clippy -and !$SkipBuild) {
352
352
if ($Test ) {
353
353
$failed = $false
354
354
355
+ $usingADO = ($null -ne $env: TF_BUILD )
356
+ $repository = ' PSGallery'
357
+
358
+ if ($usingADO ) {
359
+ $repository = ' CFS'
360
+ if ($null -eq (Get-PSResourceRepository - Name CFS - ErrorAction Ignore)) {
361
+ " Registering CFS repository"
362
+ Register-PSResourceRepository - uri ' https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2' - Name CFS - Trusted
363
+ }
364
+ }
365
+
355
366
if ($IsWindows ) {
356
367
# PSDesiredStateConfiguration module is needed for Microsoft.Windows/WindowsPowerShell adapter
357
368
$FullyQualifiedName = @ {ModuleName = " PSDesiredStateConfiguration" ;ModuleVersion = " 2.0.7" }
358
369
if (-not (Get-Module - ListAvailable - FullyQualifiedName $FullyQualifiedName ))
359
- { " Installing module PSDesiredStateConfiguration 2.0.7 "
360
- Install-PSResource - Name PSDesiredStateConfiguration - Version 2.0 .7 - Repository PSGallery - TrustRepository
370
+ {
371
+ Install-PSResource - Name PSDesiredStateConfiguration - Version 2.0 .7 - Repository $repository - TrustRepository
361
372
}
362
373
}
363
374
364
375
if (-not (Get-Module - ListAvailable - Name Pester))
365
376
{ " Installing module Pester"
366
- Install-PSResource Pester - WarningAction Ignore - Repository PSGallery - TrustRepository
377
+ Install-PSResource Pester - WarningAction Ignore - Repository $repository - TrustRepository
367
378
}
368
379
369
380
foreach ($project in $projects ) {
@@ -408,7 +419,7 @@ if ($Test) {
408
419
if (-not (Get-Module - ListAvailable - Name Pester))
409
420
{ " Installing module Pester"
410
421
$InstallTargetDir = ($env: PSModulePath -split " ;" )[0 ]
411
- Find-PSResource - Name ' Pester' - Repository ' PSGallery ' | Save-PSResource - Path $InstallTargetDir - TrustRepository
422
+ Find-PSResource - Name ' Pester' - Repository $repository | Save-PSResource - Path $InstallTargetDir - TrustRepository
412
423
}
413
424
414
425
" Updated Pester module location:"
0 commit comments