Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Symptoms
When you install Visual Studio with the parameter --productKey
like XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
, the license key shows as invalid, and the installer repeatedly asks for the license key, even though you use the license key mentioned in the package.
Resolution
According to Use command-line parameters to install, update, and manage Visual Studio, the --productkey
parameter only supports 25 alphanumeric characters in the format of XXXXXXXXXXXXXXXXXXXXXXXXX
.
Parameter | Description |
---|---|
--productKey |
Optional: During an install command, this parameter defines the product key to use for an installed product. It's composed of 25 alphanumeric characters in the format of XXXXXXXXXXXXXXXXXXXXXXXXX . |
To solve the issue, remove the dashes in XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
from the parameter --productKey
. Here's an example:
$RetVal = Execute-Process -Path "$dirFiles\vs_Professional.exe" -Parameters "--add Microsoft.VisualStudio.Workload.Data --add Microsoft.VisualStudio.Workload.DataScience --add Microsoft.VisualStudio.Workload.ManagedDesktop --locale en-US --quiet --wait --norestart --productKey XXXXXXXXXXXXXXXXXXXXXXXXX" -PassThru