File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -203,27 +203,19 @@ Azure CLI (az) not found.
203203
204204 if ($hasAz ) {
205205 # 2. azure-devops extension installed
206- $stderrFile = [System.IO.Path ]::GetTempFileName()
207- try {
208- $null = & az extension show -- name azure- devops 2> $stderrFile
209- if ($LASTEXITCODE -ne 0 ) {
210- $errors += @"
206+ $null = & az extension show -- name azure- devops 2> $null
207+ if ($LASTEXITCODE -ne 0 ) {
208+ $errors += @"
211209Azure CLI 'azure-devops' extension not found.
212210 Install with: az extension add --name azure-devops
213211"@
214- }
215- }
216- finally {
217- Remove-Item - Path $stderrFile - Force - ErrorAction SilentlyContinue
218212 }
219213
220214 # 3. Azure CLI authenticated
221- $stderrFile = [System.IO.Path ]::GetTempFileName()
222215 $accountOutput = $null
223- try {
224- $accountOutput = & az account show -- output json 2> $stderrFile
225- if ($LASTEXITCODE -ne 0 ) {
226- $errors += @"
216+ $accountOutput = & az account show -- output json 2> $null
217+ if ($LASTEXITCODE -ne 0 ) {
218+ $errors += @"
227219Azure CLI is not logged in.
228220 Run: az login
229221 For MFA-enabled tenants: az login --tenant <TENANT_ID> --use-device-code
You can’t perform that action at this time.
0 commit comments