Läs på engelska Redigera

Dela via


Deploy GitHub Copilot to existing Visual Studio instances

Administrators of Visual Studio 2022 version 17.8 or above can deploy GitHub Copilot to client workstations programmatically using an installation script, similar to deploying other Visual Studio components.

This method does NOT install the GitHub Copilot Chat extension.

Prerequisites

To get started, you need:

Options for deploying GitHub Copilot depend on how Visual Studio is currently installed on client machines.

Modify an existing installation to add the GitHub Copilot component

In most cases, users either install Visual Studio themselves, or set it up using a development environment setup script on their machine. To add the GitHub Copilot component to an existing Visual Studio installation, use the installer's modify command from either a Command Prompt or PowerShell window.

Sample installation instructions

Ensure you're in the Visual Studio Installer directory (C:\Program Files (x86)\Microsoft Visual Studio\Installer) before running the command.

$installDir = .\vswhere.exe -products * -version 17.8 -requires Microsoft.VisualStudio.Component.CoreEditor -property installationPath
foreach ($i in $installDir) {
    Write-Host "Adding Copilot to this installed instance" $i
    Start-Process -FilePath .\setup.exe -ArgumentList "modify --installPath ""$i"" --add Component.GitHub.Copilot --passive" -Wait
}

Deploy using a layout

If you're using a layout to deploy Visual Studio across your organization, follow these steps:

  1. Add the Component.GitHub.Copilot component to the layout.
  2. Ensure the client is configured to receive updates from the layout
  3. Run a modify command (as shown in the previous example) to install GitHub Copilot on the client machine.

For more information, refer to the layout documentation.

End user action required

After installing the GitHub Copilot component on client machines, the end user must complete the following steps to enable GitHub Copilot:

  1. Log in to the GitHub web interface using the GitHub account associated with their Copilot subscription.
  2. Activate access by launching Visual Studio 2022 and adding their GitHub account to the Visual Studio keychain.

To learn more, consider exploring the following resources: