Function Get-LocalDb2016NuGet {
Get Microsoft SQL Server 2016 LocalDB from Nuget.
Downloads Microsoft SQL Server 2016 LocalDB from Nuget. This Nuget package is not official release from Microsoft.
Before we use Nuget, we use the function "Install-Nuget" to check is Nuget is installed in local folder.
.PARAMETER WorkingFolder
Location that Nuget.exe is/isn't.
Location that we want to download Nuget package to.
.PARAMETER NugetInstalluri
The url used to download Nuget.
.PARAMETER targetVersion
The version of the Nuget package we want to get.
Not mandatory - will download the latest if not included.
targetMsi: the path to Microsoft SQL Server 2016 LocalDB msi, irrespective of whether it was downloaded or already existed.
$targetMsi = Get-LocalDb2016NuGet -WorkingFolder $PsScriptRoot -NugetInstallUri "" -targetVersion "13.1.4001.0"

        [Parameter(Mandatory = $true)]
        [string] $WorkingFolder,
        [Parameter(Mandatory = $false)]
        [string] $targetVersion
    $NuGetPath = Install-NuGet -WorkingFolder $WorkingFolder
    $nugetInstallLocalDb = "&$NuGetPath install Microsoft.SQL.Server.2016.LocalDB -ExcludeVersion -OutputDirectory $WorkingFolder"

    if ($targetVersion) {
        $nugetInstallLocalDb += " -version $targetVersion"
    else {
        Write-Verbose "As no version target version of Microsoft SQL Server 2016 LocalDB, the latest version will be downloaded." -Verbose
    Write-Verbose $nugetInstallLocalDb -Verbose
    Invoke-Expression $nugetInstallLocalDb | Out-Null
    $localDbInstallFolder = "$WorkingFolder\Microsoft.SQL.Server.2016.LocalDB"
    if (-not (Test-Path $localDbInstallFolder)) {
        Throw "It appears that the nuget install hasn't worked, check output above to see whats going on"
    $targetMsi = Join-Path $localDbInstallFolder "SqlLocalDB.msi"
    Return $targetMsi