ChocolateyPackages
ChocolateyPackages copied to clipboard
Start-VSModifyOperation has incorrect message when ApplicableProducts is invalid
Try running this code with $VerbosePreference set to Continue:
Add-VisualStudioWorkload -PackageName Azure -Workload Azure -VisualStudioYear 2019 -ApplicableProducts "Evsdvvf"
You will see some obviously false messages at the end:
DEBUG: This package supports Visual Studio product id(s): Microsoft.VisualStudio.Product.Evsdvvf
and
VERBOSE: Product at path 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community' will not be modified because it does not support package(s): Microsoft.VisualStudio.Workload.Azure
Well, its "garbage in, garbage out". The function does not claim to know the full list of possible product ids and the mapping between workloads and products, it relies on your telling the truth. By calling
Add-VisualStudioWorkload (...) -Workload Azure -ApplicableProducts "Evsdvvf"
you essentially told the function: "Please install the 'Azure' workload. This workload is supported by a VS 2019 product named 'Evsdvvf', so if you see that product, add the workload to it." The diagnostic messages correctly reflect the parameter values.
Now, it would probably be possible to determine the list of valid products and the workloads supported by each of them from the component manifest. I don't need this personally, but if it is important to your use case, I would welcome a pull request.