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 78
78
Write-Host "List artifacts..."
79
79
Get-ChildItem "$(Pipeline.Workspace)\\LocalRepo\\"
80
80
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
-
88
81
- task : NuGetCommand@2
89
82
condition : and(succeeded(), eq(variables['GalleryName'], 'LocalRepo'))
90
83
displayName : ' Download Previous Az .nupkg Files'
Original file line number Diff line number Diff line change @@ -42,13 +42,6 @@ Register-Gallery $gallery $localRepoLocation
42
42
43
43
Write-Host " Installing Az..."
44
44
Install-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
- }
52
45
53
46
# Check version
54
47
Import-Module - MinimumVersion ' 2.6.0' - Name ' Az' - Force
@@ -61,4 +54,4 @@ Get-Module -Name Az.* -ListAvailable
61
54
62
55
if (! $azVersion ) {
63
56
throw " No Az is installed"
64
- }
57
+ }
Original file line number Diff line number Diff line change @@ -56,6 +56,22 @@ function Install-PowerShell {
56
56
dotnet tool run pwsh - c $command
57
57
}
58
58
}
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
+ }
59
75
}
60
76
61
77
# Image "macOS-10.15" preinstalled Az modules
You can’t perform that action at this time.
0 commit comments