Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$env:UNITY_SETUP_INSTANCE_DEFAULT_BASEPATH should be either a string of comma separated values, or an array of strings #246

Open
ryan-beesley opened this issue Mar 2, 2023 · 0 comments

Comments

@ryan-beesley
Copy link

The idiomatic PowerShell way to pass more than one string, would be to create a String[] and pass that in as an argument. Allowing the $env:UNITY_SETUP_INSTANCE_DEFAULT_BASEPATH environment variable to also support a PowerShell String[] allows you to create the environment variable from within a shell or as part of the $PROFILE. As a string of comma separated values, it still has value when defined externally, like in Windows environment variables, where it isn't possible to define the String[] as a PowerShell object. Outside that case, a string array is easier to manage in a PowerShellesque way.

As an example, $env:UNITY_SETUP_INSTANCE_DEFAULT_BASEPATH = @('C:\Program Files*\Unity*', 'C:\Program Files\Unity\Hub\Editor\*') and $env:UNITY_SETUP_INSTANCE_DEFAULT_BASEPATH = "C:\Program Files*\Unity*, C:\Program Files\Unity\Hub\Editor\*" should be processed the same way by unitysetup.powershell. The first when defined from a PowerShell session or script, and the second when defined as a System or User environment variable.

Both have their merits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants