Skip to content

Commit 97bef66

Browse files
authored
[Tools] Switch the location of nuget packages referred by Docs team to storage account (#20137)
* switch the location of nuget packages to storage account * update az-ps-latest
1 parent 17f5f76 commit 97bef66

File tree

3 files changed

+162
-149
lines changed

3 files changed

+162
-149
lines changed

tools/Docs/GenerateDotNetCsv.ps1

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ Param(
1818
[Parameter(Mandatory = $true)]
1919
[string]$FeedPsd1FullPath,
2020
[Parameter(Mandatory = $false)]
21-
[string]$CustomSource = "https://www.powershellgallery.com/api/v2/"
21+
[string]$CustomSource = "https://azpspackage.blob.core.windows.net/docs-release",
22+
[Parameter(Mandatory = $false)]
23+
[string]$SourceType = "sa"
2224
)
2325

2426
$feedDir = (Get-Item $FeedPsd1FullPath).Directory
@@ -28,10 +30,21 @@ $modules = $ModuleMetadata.RequiredModules
2830

2931
$dotnetCsv = New-Item -Path "$PSScriptRoot\" -Name "az-ps-latest.csv" -ItemType "file" -Force
3032
$dotnetCsvContent = ""
33+
3134
for ($index = 0; $index -lt $modules.Count; $index++){
3235
$moduleName = $modules[$index].ModuleName
3336
$moduleVersion = [string]::IsNullOrEmpty($modules[$index].RequiredVersion) ? $modules[$index].ModuleVersion : $modules[$index].RequiredVersion
34-
$dotnetCsvContent += "pac$index,[ps=true;customSource=$CustomSource]$moduleName,$moduleVersion`n"
37+
$dotnetCsvLine = ""
38+
switch ($SourceType) {
39+
"sa" {
40+
$dotnetCsvLine = "pac$index,[ps=true;customSource=$CustomSource/$moduleName.$moduleVersion.nupkg;sourceType=$SourceType]$moduleName,$moduleVersion`n"
41+
break
42+
}
43+
Default {
44+
$dotnetCsvLine = "pac$index,[ps=true;customSource=$CustomSource]$moduleName,$moduleVersion`n"
45+
}
46+
}
47+
$dotnetCsvContent += $dotnetCsvLine
3548
}
3649
Set-Content -Path $dotnetCsv.FullName -Value $dotnetCsvContent -Encoding UTF8
3750

0 commit comments

Comments
 (0)