Skip to content

Commit

Permalink
[Tools] Switch the location of nuget packages referred by Docs team t…
Browse files Browse the repository at this point in the history
…o storage account (Azure#20137)

* switch the location of nuget packages to storage account

* update az-ps-latest
  • Loading branch information
BethanyZhou authored Nov 17, 2022
1 parent 17f5f76 commit 97bef66
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 149 deletions.
17 changes: 15 additions & 2 deletions tools/Docs/GenerateDotNetCsv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Param(
[Parameter(Mandatory = $true)]
[string]$FeedPsd1FullPath,
[Parameter(Mandatory = $false)]
[string]$CustomSource = "https://www.powershellgallery.com/api/v2/"
[string]$CustomSource = "https://azpspackage.blob.core.windows.net/docs-release",
[Parameter(Mandatory = $false)]
[string]$SourceType = "sa"
)

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

$dotnetCsv = New-Item -Path "$PSScriptRoot\" -Name "az-ps-latest.csv" -ItemType "file" -Force
$dotnetCsvContent = ""

for ($index = 0; $index -lt $modules.Count; $index++){
$moduleName = $modules[$index].ModuleName
$moduleVersion = [string]::IsNullOrEmpty($modules[$index].RequiredVersion) ? $modules[$index].ModuleVersion : $modules[$index].RequiredVersion
$dotnetCsvContent += "pac$index,[ps=true;customSource=$CustomSource]$moduleName,$moduleVersion`n"
$dotnetCsvLine = ""
switch ($SourceType) {
"sa" {
$dotnetCsvLine = "pac$index,[ps=true;customSource=$CustomSource/$moduleName.$moduleVersion.nupkg;sourceType=$SourceType]$moduleName,$moduleVersion`n"
break
}
Default {
$dotnetCsvLine = "pac$index,[ps=true;customSource=$CustomSource]$moduleName,$moduleVersion`n"
}
}
$dotnetCsvContent += $dotnetCsvLine
}
Set-Content -Path $dotnetCsv.FullName -Value $dotnetCsvContent -Encoding UTF8

Expand Down
Loading

0 comments on commit 97bef66

Please sign in to comment.