Skip to content

Commit 447451b

Browse files
authored
Add YamlDotNet installation step to pipeline and remove redundant code (#28220)
1 parent f27c4e6 commit 447451b

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.azure-pipelines/sync-aliases.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,20 @@ jobs:
3434
dotnet tool install powershell --version 7.4.*
3535
displayName: Install PowerShell 7.4.x
3636
37+
- pwsh: |
38+
if (-not (Get-PackageProvider -Name NuGet -ErrorAction SilentlyContinue)) {
39+
Install-PackageProvider -Name NuGet -Force
40+
}
41+
Install-Package -Name YamlDotNet -RequiredVersion $(YamlDotNetVersion) -ProviderName NuGet -Force -ErrorAction Stop
42+
displayName: Install YamlDotNet NuGet Package
43+
retryCountOnTaskFailure: 5
44+
3745
- pwsh: |
3846
dotnet tool run pwsh -NoLogo -NoProfile -NonInteractive -File ./tools/Github/ParseServiceContactsList.ps1 -AccessToken $env:SYSTEM_ACCESSTOKEN
3947
env:
4048
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
4149
displayName: Update resourceManagement.yml file locally
50+
condition: succeeded()
4251
4352
- pwsh: |
4453
$hasChanges = git diff --name-only .github/policies

tools/Github/ParseServiceContactsList.ps1

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ function InitializeRequiredPackages {
2626
[CmdletBinding()]
2727
param ()
2828

29-
if (-not (Get-PackageProvider -Name NuGet -ErrorAction SilentlyContinue)) {
30-
Install-PackageProvider -Name NuGet -Force
31-
}
32-
33-
Install-Package -Name YamlDotNet -RequiredVersion ${env:YamlDotNetVersion} -ProviderName NuGet -Force
3429
$pkgYaml = Get-Package -Name YamlDotNet | Select-Object -ExpandProperty Source | Split-Path
3530
$dllYaml = Join-Path -Path $pkgYaml -ChildPath "lib" | Join-Path -ChildPath "netstandard2.0" | Join-Path -ChildPath "YamlDotNet.dll"
3631
Add-Type -LiteralPath $dllYaml

0 commit comments

Comments
 (0)