Source/Toolbox/Get-ToolboxDataLocation.ps1

<#
.SYNOPSIS
    Gets the Toolbox data location.
.DESCRIPTION
    Reads the "ToolboxData" User environment variable via Get-EnvironmentVariable. Falls back to "$Home\.toolbox" when it isn't set.
.EXAMPLE
    Get-ToolboxDataLocation
.INPUTS
    None.
.OUTPUTS
    [System.String] The resolved Toolbox data location.
#>


function Get-ToolboxDataLocation {

    [OutputType([string])]
    [CmdletBinding()]

    param()

    $location = Get-EnvironmentVariable -Name "ToolboxData" -Scope "User"

    if ([string]::IsNullOrEmpty($location)) {

        return "$Home\.toolbox"

    }

    return $location

}