Skip to content

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

@ryan-beesley

Description

@ryan-beesley

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions