[AzureStack] Updating modules versions and Adding support for downloading preview modules (#14771)

* Update module versions to 0.11.0

* "Adding support for downloading -preview modules from the PsGallery"
This commit is contained in:
bganapa 2021-04-18 21:16:36 -07:00 коммит произвёл GitHub
Родитель e8797b0e89
Коммит d90db4f8f8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
8 изменённых файлов: 18 добавлений и 8 удалений

Просмотреть файл

@ -12,7 +12,7 @@
# RootModule = ''
# Version number of this module.
ModuleVersion = '0.10.0'
ModuleVersion = '0.11.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'

Просмотреть файл

@ -12,7 +12,7 @@
# RootModule = ''
# Version number of this module.
ModuleVersion = '0.10.0'
ModuleVersion = '0.11.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'

Просмотреть файл

@ -12,7 +12,7 @@
# RootModule = ''
# Version number of this module.
ModuleVersion = '0.10.0'
ModuleVersion = '0.11.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'

Просмотреть файл

@ -12,7 +12,7 @@
# RootModule = ''
# Version number of this module.
ModuleVersion = '0.10.0'
ModuleVersion = '0.11.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'

Просмотреть файл

@ -12,7 +12,7 @@
# RootModule = ''
# Version number of this module.
ModuleVersion = '0.10.0'
ModuleVersion = '0.11.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'

Просмотреть файл

@ -12,7 +12,7 @@
# RootModule = ''
# Version number of this module.
ModuleVersion = '0.10.0'
ModuleVersion = '0.11.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'

Просмотреть файл

@ -12,7 +12,7 @@
# RootModule = ''
# Version number of this module.
ModuleVersion = '0.10.0'
ModuleVersion = '0.11.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'

Просмотреть файл

@ -492,7 +492,17 @@ function Save-PackageLocally {
Write-Output "Downloading the package from PsGallery to the path $TempRepoPath"
# We try to download the package from the PsGallery as we are likely intending to use the existing version of the module.
# If the module not found in psgallery, the following commnad would fail and hence publish to local repo process would fail as well
Save-Package -Name $ModuleName -RequiredVersion $RequiredVersion -ProviderName Nuget -Path $TempRepoPath -Source https://www.powershellgallery.com/api/v2 | Out-Null
$PSGalleryRepository = Get-PSRepository | Where-Object {$_.Name -eq "PSGallery"}
if (!$PSGalleryRepository) {
Register-PSRepository -Default
}
$module = Find-Module -Name $ModuleName -Repository PSGallery -AllVersions -AllowPrerelease
| Where-Object {$_.Version -like "${RequiredVersion}*"}
if ($module.Version -match "-preview")
{
$RequiredVersion = $module.Version
}
Save-Package -Name $ModuleName -RequiredVersion $RequiredVersion -ProviderName Nuget -Path $TempRepoPath -Source https://www.powershellgallery.com/api/v2 -AllowPrereleaseVersions | Out-Null
Write-Output "Downloaded the package sucessfully"
}
}