Skip to content

Commit

Permalink
Fix ThreadJob installation error of smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
msJinLei committed Feb 7, 2023
1 parent 8afc22b commit 26d7775
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tools/Test/SmokeTest/InstallAzModules.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,20 @@ Register-Gallery $gallery $localRepoLocation
Write-Host "Installing Az..."
Install-Module -Name Az -Repository $gallery -Scope CurrentUser -AllowClobber -Force

$file = Get-ChildItem $localRepoLocation | Where-Object {$_.Name -like "ThreadJob*"}
$installedModule = Get-Module -ListAVailable -Name ThreadJob
if ($file -ne $null -and $installedModule -eq $null) {
Write-Host "Install ThreadJob..."
Install-Module -Name ThreadJob -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 Down

0 comments on commit 26d7775

Please sign in to comment.