File tree Expand file tree Collapse file tree 3 files changed +17
-15
lines changed
Expand file tree Collapse file tree 3 files changed +17
-15
lines changed Original file line number Diff line number Diff line change 7878 Write-Host "List artifacts..."
7979 Get-ChildItem "$(Pipeline.Workspace)\\LocalRepo\\"
8080
81- - task : NuGetCommand@2
82- condition : and(succeeded(), eq('${{ parameters.psVersion }}', '5.1.14'))
83- displayName : ' Download ThreadJob .nupkg File for PowerShell 5.1.14'
84- inputs :
85- command : custom
86- arguments : ' install ThreadJob -directdownload -packagesavemode nupkg -source https://www.powershellgallery.com/api/v2 -OutputDirectory packages'
87-
8881 - task : NuGetCommand@2
8982 condition : and(succeeded(), eq(variables['GalleryName'], 'LocalRepo'))
9083 displayName : ' Download Previous Az .nupkg Files'
Original file line number Diff line number Diff line change @@ -42,13 +42,6 @@ Register-Gallery $gallery $localRepoLocation
4242
4343Write-Host " Installing Az..."
4444Install-Module - Name Az - Repository $gallery - Scope CurrentUser - AllowClobber - Force
45-
46- $file = Get-ChildItem $localRepoLocation | Where-Object {$_.Name -like " ThreadJob*" }
47- $installedModule = Get-Module - ListAVailable - Name ThreadJob
48- if ($file -ne $null -and $installedModule -eq $null ) {
49- Write-Host " Install ThreadJob..."
50- Install-Module - Name ThreadJob - Repository $gallery - Scope CurrentUser - AllowClobber - Force
51- }
5245
5346# Check version
5447Import-Module - MinimumVersion ' 2.6.0' - Name ' Az' - Force
@@ -61,4 +54,4 @@ Get-Module -Name Az.* -ListAvailable
6154
6255if (! $azVersion ) {
6356 throw " No Az is installed"
64- }
57+ }
Original file line number Diff line number Diff line change @@ -56,6 +56,22 @@ function Install-PowerShell {
5656 dotnet tool run pwsh - c $command
5757 }
5858 }
59+
60+ # Install ThreadJob for Windows PowerShell
61+ if ($requiredPsVersion -eq $windowsPowershellVersion ) {
62+ Write-Host " Install ThreadJob for Windows PowerShell."
63+ $installedModule = Get-Module - ListAVailable - Name ThreadJob
64+ if ($installedModule -eq $null ) {
65+ try {
66+ Install-Module - Name ThreadJob - Repository PSGallery - Scope CurrentUser - AllowClobber - Force
67+ Write-Host " Install ThreadJob successfully."
68+ }
69+ catch {
70+ Write-Host " Fail to install ThreadJob from PSGallery."
71+ Write-Host $_
72+ }
73+ }
74+ }
5975}
6076
6177# Image "macOS-10.15" preinstalled Az modules
You can’t perform that action at this time.
0 commit comments