Change:
} const [installedExtension] = installed.filter(e => areSameExtensions({ id: getGalleryExtensionIdFromLocal(e) }, { id })); <del> if (installedExtension) { </del> <ins> if (installedExtension && !force) { </ins> const outdated = semver.gt(extension.version, installedExtension.manifest.version); if (outdated) { const updateMessage = localize('updateMessage', "Extension '{0}' v{1} is already installed, but a newer version {2} is available in the marketplace. Would you like to update?", id, installedExtension.manifest.version, extension.version);

Discussion:
<!-- Please search existing issues to avoid creating duplicates. --<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: --<!-- Use Help Report Issue to prefill these. --- VSCode Version: 1.27.1 OS Version: MacOS 10.13.6 I have found that I am unable to reliably install extensions via the command line because of an update prompt that requires user interaction. A flag like or or would be helpful in allowing the command to run non-interactively. Steps to Reproduce: (or any extension that has a newer version than the one you have installed) appears: <!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes (CLI command)
May I know the use case why do you want to run this non interactively?
Thanks for the reply. I use the VS Code CLI to install extensions in . Managing my extensions in my dotfiles helps keep them in sync between my personal and work computers. You can see the script that uses the CLI .
I agree that the CLI should have a way to run every command, especially extension based commands without interaction. I also have an installer that is installing a list of VS Code extensions, and while I haven't directly seen this issue yet, it would be a major issue if it did.
Use --force to not to show prompts
Based on the code I could see in the pull request, it looks like this may prevent the command from updating already-installed extensions. Is that the case? If so, they will be updated through some other mechanism, correct? edit: I installed VS Code Insiders and will verify that the feature works for me when it arrives in the insiders build.
No, it will not prevent. If there is an update and you pass command, I would skip prompting and install the extension directly.
I was able to verify that the fix is working for me. Thanks for jumping on this!
I opened a related issue when testing this. However, I can actually repro that same issue when taking a previously installed extension and just updating its to be an older version, making this issue broken or at least unverifiable for me.
May I know if you reopened this issue because of or is there something else not working here?
I can reproduce the error you see in and it is happening only in windows.

Not sure if it is necessary to have both issues open. Is it ok to close the other one and track it here?
I think let's have them separate. This issue is for allow installing / updating extension without any prompt and other issue should show the prompt while updating.
Did you try updating the extension using argument here?
argument updates the extension without any prompts on Windows. Closing this. Please do verify. Let's track the prompts related issue in the other one you created ()