File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -352,23 +352,31 @@ if (!$Clippy -and !$SkipBuild) {
352
352
if ($Test ) {
353
353
$failed = $false
354
354
355
- if ($null -eq (Get-PSResourceRepository - Name CFS - ErrorAction Ignore)) {
356
- " Registering CFS repository"
357
- Register-PSResourceRepository - uri ' https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2' - Name CFS - Trusted
355
+ $usingADO = ($null -ne $env: TF_BUILD )
356
+
357
+ if ($usingADO ) {
358
+ $repository = ' CFS'
359
+ if ($null -eq (Get-PSResourceRepository - Name CFS - ErrorAction Ignore)) {
360
+ " Registering CFS repository"
361
+ Register-PSResourceRepository - uri ' https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2' - Name CFS - Trusted
362
+ }
363
+ }
364
+ else {
365
+ $repository = ' PSGallery'
358
366
}
359
367
360
368
if ($IsWindows ) {
361
369
# PSDesiredStateConfiguration module is needed for Microsoft.Windows/WindowsPowerShell adapter
362
370
$FullyQualifiedName = @ {ModuleName = " PSDesiredStateConfiguration" ;ModuleVersion = " 2.0.7" }
363
371
if (-not (Get-Module - ListAvailable - FullyQualifiedName $FullyQualifiedName ))
364
372
{ " Installing module PSDesiredStateConfiguration 2.0.7"
365
- Install-PSResource - Name PSDesiredStateConfiguration - Version 2.0 .7 - Repository CFS - Verbose
373
+ Install-PSResource - Name PSDesiredStateConfiguration - Version 2.0 .7 - Repository $repository
366
374
}
367
375
}
368
376
369
377
if (-not (Get-Module - ListAvailable - Name Pester))
370
378
{ " Installing module Pester"
371
- Install-PSResource Pester - WarningAction Ignore - Repository CFS - Verbose
379
+ Install-PSResource Pester - WarningAction Ignore - Repository $repository
372
380
}
373
381
374
382
foreach ($project in $projects ) {
You can’t perform that action at this time.
0 commit comments