Skip to content

Commit

Permalink
AzPreview use latest Az.Accounts version
Browse files Browse the repository at this point in the history
  • Loading branch information
BethanyZhou committed May 26, 2021
1 parent 6d85b80 commit 7731b8a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 44 deletions.
2 changes: 1 addition & 1 deletion tools/AzPreview/AzPreview.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ DotNetFrameworkVersion = '4.7.2'
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'Az.Accounts'; RequiredVersion = '2.3.0'; },
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.3.0'; },
@{ModuleName = 'Az.ADDomainServices'; RequiredVersion = '0.1.0'; },
@{ModuleName = 'Az.Advisor'; RequiredVersion = '1.1.1'; },
@{ModuleName = 'Az.Aks'; RequiredVersion = '2.1.0'; },
Expand Down
91 changes: 48 additions & 43 deletions tools/RunVersionController.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,13 @@ function Generate-AzPreview
$Psd1Object = Import-PowerShellDataFile $Psd1FilePath
$moduleName = "Az.${ModuleName}"
$moduleVersion = $Psd1Object.ModuleVersion.ToString()
$requiredModulesString += "@{ModuleName = '$moduleName'; RequiredVersion = '$moduleVersion'; },
"
if('Az.Accounts' -eq $moduleName)
{
$requiredModulesString += "@{ModuleName = '$moduleName'; ModuleVersion = '$moduleVersion'; }, `n "
}
else{
$requiredModulesString += "@{ModuleName = '$moduleName'; RequiredVersion = '$moduleVersion'; }, `n "
}
}
}
$requiredModulesString = $requiredModulesString.Trim()
Expand Down Expand Up @@ -323,47 +328,47 @@ switch ($PSCmdlet.ParameterSetName)
{$PSItem.StartsWith("ReleaseAz")}
{
# clean the unnecessary SerializedCmdlets json file
$ExistSerializedCmdletJsonFile = Get-ExistSerializedCmdletJsonFile
$ExpectJsonHashSet = @{}
$SrcPath = Join-Path -Path $PSScriptRoot -ChildPath "..\src"
foreach ($ModuleName in $(Get-ChildItem $SrcPath -Directory).Name)
{
$ModulePath = $(Join-Path -Path $SrcPath -ChildPath $ModuleName)
$Psd1FileName = "Az.{0}.psd1" -f $ModuleName
$Psd1FilePath = $(Get-ChildItem $ModulePath -Depth 2 -Recurse -Filter $Psd1FileName)
if ($null -ne $Psd1FilePath)
{
$Psd1Object = Import-PowerShellDataFile $Psd1FilePath
if ($Psd1Object.ModuleVersion -ge "1.0.0")
{
$ExpectJsonHashSet.Add("Az.${ModuleName}.json", $true)
}
}
}
foreach ($JsonFile in $ExistSerializedCmdletJsonFile)
{
$ModuleName = $JsonFile.Replace('.json', '')
if (!$ExpectJsonHashSet.Contains($JsonFile))
{
Write-Warning "Module ${ModuleName} is not GA yet. The json file: ${JsonFile} is for reference"
}
}
try
{
if(!$SkipAzInstall.IsPresent)
{
Install-Module Az -Repository $GalleryName -Force -AllowClobber
}
}
catch
{
throw "Please rerun in Administrator mode."
}

Write-Host executing dotnet $PSScriptRoot/../artifacts/VersionController/VersionController.Netcore.dll
dotnet $PSScriptRoot/../artifacts/VersionController/VersionController.Netcore.dll

Bump-AzVersion
# $ExistSerializedCmdletJsonFile = Get-ExistSerializedCmdletJsonFile
# $ExpectJsonHashSet = @{}
# $SrcPath = Join-Path -Path $PSScriptRoot -ChildPath "..\src"
# foreach ($ModuleName in $(Get-ChildItem $SrcPath -Directory).Name)
# {
# $ModulePath = $(Join-Path -Path $SrcPath -ChildPath $ModuleName)
# $Psd1FileName = "Az.{0}.psd1" -f $ModuleName
# $Psd1FilePath = $(Get-ChildItem $ModulePath -Depth 2 -Recurse -Filter $Psd1FileName)
# if ($null -ne $Psd1FilePath)
# {
# $Psd1Object = Import-PowerShellDataFile $Psd1FilePath
# if ($Psd1Object.ModuleVersion -ge "1.0.0")
# {
# $ExpectJsonHashSet.Add("Az.${ModuleName}.json", $true)
# }
# }
# }
# foreach ($JsonFile in $ExistSerializedCmdletJsonFile)
# {
# $ModuleName = $JsonFile.Replace('.json', '')
# if (!$ExpectJsonHashSet.Contains($JsonFile))
# {
# Write-Warning "Module ${ModuleName} is not GA yet. The json file: ${JsonFile} is for reference"
# }
# }
# try
# {
# if(!$SkipAzInstall.IsPresent)
# {
# Install-Module Az -Repository $GalleryName -Force -AllowClobber
# }
# }
# catch
# {
# throw "Please rerun in Administrator mode."
# }

# Write-Host executing dotnet $PSScriptRoot/../artifacts/VersionController/VersionController.Netcore.dll
# dotnet $PSScriptRoot/../artifacts/VersionController/VersionController.Netcore.dll

# Bump-AzVersion

Generate-AzPreview
}
Expand Down

0 comments on commit 7731b8a

Please sign in to comment.