microsoft / microsoft/aspire

Don't clean up extension if extension isntall fails

Open
#19,473 0 comments 0 reactions 0 assignees View on GitHub
area-vscode
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

When running `iex "& { $(irm https://aspire.dev/install.ps1) } -InstallExtension -Quality dev"` I hit a problem with my corporate policy blocking the extension.

I wanted to do some further inspection on the extension to see waht values I need to allow list, but the script deleted the extension from the temporary directory before I could do so.

```
WARNING: Failed to install VS Code extension: Extension installation failed with exit code 1: Installing extensions... Error: This extension cannot be installed because it is not in the [allowed list](command:workbench.action.openSettings?%255B%257B%2522query%2522%253A%2522%2540id%253Aextensions.allowed%2522%257D%255D) at ro.install (file:///C:/Users/alexanderc/AppData/Local/Programs/Microsoft%20VS%20Code/df53daabb1/resources/app/out/vs/code/node/cliProcessMain.js:464:39767) at process.processTicksAndRejections (node:internal/process/task_queues:104:5) at async Wn.installVSIX (file:///C:/Users/alexanderc/AppData/Local/Programs/Microsoft%20VS%20Code/df53daabb1/resources/app/out/vs/code/node/cliProcessMain.js:457:1087) at async file:///C:/Users/alexanderc/AppData/Local/Programs/Microsoft%20VS%20Code/df53daabb1/resources/app/out/vs/code/node/cliProcessMain.js:456:2216 at async Promise.all (index 0) at async Wn.installExtensions (file:///C:/Users/alexanderc/AppData/Local/Programs/Microsoft%20VS%20Code/df53daabb1/resources/app/out/vs/code/node/cliProcessMain.js:456:2153) at async file:///C:/Users/alexanderc/AppData/Local/Programs/Microsoft%20VS%20Code/df53daabb1/resources/app/out/vs/code/node/cliProcessMain.js:493:59119 at async Module.PK (file:///C:/Users/alexanderc/AppData/Local/Programs/Microsoft%20VS%20Code/df53daabb1/resources/app/out/vs/code/node/cliProcessMain.js:493:63094) at async As (file:///C:/Users/alexanderc/AppData/Local/Programs/Microsoft%20VS%20Code/df53daabb1/resources/app/out/cli.js:433:70559) Failed Installing Extensions: file:///c%3A/Users/alexanderc/AppData/Local/Temp/aspire-extension-fbb42f17/aspire-vscode-1.17.0.vsix
WARNING: The CLI was installed successfully, but the extension installation failed
```

### Describe the solution you'd like

If extension install fails, don't auto remove the extension to allow further investigation.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with install.ps1 and trace the -InstallExtension path invoked by the reported PowerShell command, focusing on cleanup after the VS Code extension installation fails. Reproduce the blocked-install case and verify that the .vsix remains in the temporary directory while the CLI still reports the installation failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, vscode
Domain
cli, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.