core/Resources/Scripts/get_license_key.ps1


Param(
    [Parameter(Mandatory)]
    $ResourceName
)
$resource = $null

function GetLicenseKey{
    if($resource.Tags){
        return $resource.Tags
    }
}

function ExecuteCommands {
    $resource = Get-AzResourceGroup | Where-Object { $_.Tags -and $_.Tags.Contains("EnvironmentName") -and $_.Tags["EnvironmentName"] -eq $ResourceName } -ErrorAction Stop 
    if (-not $resource) {
        throw "No such environment exists"
    }
    return GetLicenseKey
}



return ExecuteCommands