Closed nicdompierre closed 5 months ago
Yes, those path arguments are troublesome; the package parameters parser was implemented long before Microsoft added them. The fix seems reasonable, I'll incorporate it (but no promises as to when).
Or maybe it will be simpler to just add "path" to the list of allowed multivalue parameters.
Another wrinkle: --path install=<path>
is an alias for –-installPath <path>
, so it would need to be recognized as such.
Another wrinkle:
--path install=<path>
is an alias for–-installPath <path>
, so it would need to be recognized as such.
Yeah, i hoped for an alias like --cachePath and --sharedPath, but they don't exist nor don't works at all.
Implemented in extension 1.11.0, currently in preview. Example:
cup -y chocolatey-visualstudio.extension --version 1.11.0-preview7
cup -y visualstudio2022buildtools --params "--locale en-US --path install=C:\VS 2022 BT --path shared=C:\VS 2022 Shared --path cache=C:\VS 2022 Cache --includeRecommended --includeOptional"
--path install=...
is synonymous with --installPath ...
(in fact, the extension internally converts the former to the latter).
The visual studio installer have a special arguments with space within their neme:
--path cache="C:\VS\cache" --path shared="C:\VS\shared"
When passing theses arguments to chocolatey the Parse-Parameters in Parse-Parameters.ps1 in the extension crash as key and values are splitted by their space between them:
Exception lors de l'appel de « Add » avec « 2 » argument(s) : « L'élément a déjà été ajouté. Clé du dictionnaire : 'path' Clé ajoutée : 'path' »
I fixed it on my end this way, but it would be nice to get it fixed officially:
https://learn.microsoft.com/en-us/visualstudio/install/command-line-parameter-examples?view=vs-2022