jberezanski / ChocolateyPackages

Chocolatey packages maintained by me
MIT License
83 stars 51 forks source link

Is possible to set --installPath <dir>. #111

Closed JRSerjeant closed 5 months ago

JRSerjeant commented 2 years ago

Hello,

I would like to define a custom install location for Visual Studio.

Using Install-VisualStudio from chocolatey-visualstudio.extension is it possible to set --installPath <dir>?

Thanks

jberezanski commented 2 years ago

Yes, it is. However, currently it can be done only by modifying the environment variable used by Chocolatey to pass package parameters:

$Env:chocolateyPackageParameters = '--installPath C:\VS'
Install-VisualStudio ...
jberezanski commented 2 years ago

I've wanted to implement a facility for passing such additional parameters directly to Install-VisualStudio (and Install-VisualStudioWorkload) for a long time, but never found the time to do it, unfortunately. I'd welcome a PR, though.

jberezanski commented 1 year ago

Available in extension 1.11.0 (currently in preview) as a new parameter of Install-VisualStudio and other public functions (-DefaultParameterValues <hashtable>).