Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
msJinLei committed Feb 9, 2023
1 parent 26d7775 commit 9bc9572
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
7 changes: 0 additions & 7 deletions .azure-pipelines/util/smoke-test-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ jobs:
Write-Host "List artifacts..."
Get-ChildItem "$(Pipeline.Workspace)\\LocalRepo\\"
- task: NuGetCommand@2
condition: and(succeeded(), eq('${{ parameters.psVersion }}', '5.1.14'))
displayName: 'Download ThreadJob .nupkg File for PowerShell 5.1.14'
inputs:
command: custom
arguments: 'install ThreadJob -directdownload -packagesavemode nupkg -source https://www.powershellgallery.com/api/v2 -OutputDirectory packages'

- task: NuGetCommand@2
condition: and(succeeded(), eq(variables['GalleryName'], 'LocalRepo'))
displayName: 'Download Previous Az .nupkg Files'
Expand Down
17 changes: 1 addition & 16 deletions tools/Test/SmokeTest/InstallAzModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,6 @@ Register-Gallery $gallery $localRepoLocation

Write-Host "Installing Az..."
Install-Module -Name Az -Repository $gallery -Scope CurrentUser -AllowClobber -Force

if ($PSVersionTable.PSEdition -eq 'Desktop') {
$installedModule = Get-Module -ListAVailable -Name ThreadJob
if ($installedModule -eq $null) {
try {
Install-Module -Name ThreadJob -Repository $gallery -Scope CurrentUser -AllowClobber -Force
Write-Host "Install ThreadJob successfully."
}
catch {
Write-Host "Fail to install ThreadJob from ${gallery}."
Write-Host $_
}
}
}


# Check version
Import-Module -MinimumVersion '2.6.0' -Name 'Az' -Force
Expand All @@ -69,4 +54,4 @@ Get-Module -Name Az.* -ListAvailable

if (!$azVersion) {
throw "No Az is installed"
}
}
16 changes: 16 additions & 0 deletions tools/Test/SmokeTest/PrepareRequiredPowershell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ function Install-PowerShell {
}
}

#Install ThreadJob for Windows PowerShell
if ($requiredPsVersion -eq $windowsPowershellVersion) {
Write-Host "Install ThreadJob for Windows PowerShell."
$installedModule = Get-Module -ListAVailable -Name ThreadJob
if ($installedModule -eq $null) {
try {
Install-Module -Name ThreadJob -Repository PSGallery -Scope CurrentUser -AllowClobber -Force
Write-Host "Install ThreadJob successfully."
}
catch {
Write-Host "Fail to install ThreadJob from PSGallery."
Write-Host $_
}
}
}

# Image "macOS-10.15" preinstalled Az modules
# Image "vs2017-win2016" and "ubuntu-18.04" preinstalled AzureRM modules.

Expand Down

0 comments on commit 9bc9572

Please sign in to comment.