File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,12 +8,16 @@ function Install-AzDevops {
88 Param (
99 )
1010
11- $telemetryScope = InitTelemetryScope - name $MyInvocation.InvocationName - parameterValues $PSBoundParameters - includeParameters @ ()
12- try {
11+ $telemetryScope = InitTelemetryScope - name $MyInvocation.InvocationName - parameterValues $PSBoundParameters - includeParameters @ ()
12+ try {
1313
1414 Try {
15- az upgrade
15+ $az_upgrade = Write-Output n | az upgrade 2>&1
1616 } catch {
17+ $az_upgrade = " "
18+ }
19+
20+ if (@ ($az_upgrade | Select-String " Latest version available" ).Count -ne 0 ) {
1721 Invoke-WebRequest - Uri https:// aka.ms/ installazurecliwindows - OutFile .\AzureCLI.msi; Start-Process msiexec.exe - Wait - ArgumentList ' /I AzureCLI.msi /quiet' ; rm .\AzureCLI.msi
1822 }
1923 $extensions = az extension list - o json | ConvertFrom-Json
@@ -29,13 +33,13 @@ try {
2933 if ($devopsFound -eq $False ){
3034 az extension add - n azure- devops
3135 }
32- }
33- catch {
34- TrackException - telemetryScope $telemetryScope - errorRecord $_
35- throw
36- }
37- finally {
38- TrackTrace - telemetryScope $telemetryScope
36+ }
37+ catch {
38+ TrackException - telemetryScope $telemetryScope - errorRecord $_
39+ throw
40+ }
41+ finally {
42+ TrackTrace - telemetryScope $telemetryScope
3943}
4044}
4145Export-ModuleMember - Function Install-AzDevops
You can’t perform that action at this time.
0 commit comments