<commit_before><#
    .DESCRIPTION
THis gets the licensefile for one of the ISV. Even though the template is public, it wont run in any account.


    .NOTES
        AUTHOR: PK
        LASTEDIT: Mar 30, 2016
#>
workflow Get-FortinetLicense
{


    [OutputType([string])]
	
	
    param (
    [Parameter(Mandatory=$true)]
    [string] 
    $Tdid,
    
    [Parameter(Mandatory=$true)]
    [string] 
    $accountName,
    
    [Parameter(Mandatory=$true)]
    [string] 
    $variableName,
    
    [Parameter(Mandatory=$true)]
    [string] 
    $ISVName,
    
    [Parameter(Mandatory=$true)]
    [string] 
    $credentialName,
    
    [Parameter(Mandatory=$true)]
    [string] 
    $resourceGroupName
    
    )
    
    #The name of the Automation Credential Asset this runbook will use to authenticate to Azure.
    $CredentialAssetName = $credentialName

    #Get the credential with the above name from the Automation Asset store
    $Cred = Get-AutomationPSCredential -Name $CredentialAssetName
    if(!$Cred) {
        Throw "Could not find an Automation Credential Asset named '${CredentialAssetName}'. Make sure you have created one in this Automation Account."
    }

    #Connect to your Azure Account
    #Add-AzureAccount -Credential $Cred
    Add-AzureRmAccount -Credential $Cred
	
	

    $Account1 = $accountName
 #$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
#$headers.Add("x-api-key", '<KEY>')
	
	$headers = @{
    'x-api-key'= '<KEY>'
}
	
	
	$fnbody = @{
    testdriveid=$Tdid
}
$json = $fnbody | ConvertTo-Json
$response = Invoke-RestMethod 'https://sxmguodehi.execute-api.us-west-2.amazonaws.com/prod/licenseManager?apikey=<KEY>' -Method Put -Headers $headers -Body $json -ContentType 'application/json'
	
   # $blobURL ='https://fortinetkeys.blob.core.windows.net/licensefiles/arm_template-3.json.zip?st=2016-03-29T03%3A44%3A25Z&se=2016-03-29T07%3A04%3A25Z&sp=r&sv=2015-04-05&sr=b&sig=8qXrBQF0AWcXU6XXOwjCvQhiycy4mqvMmrZhYLdaW4k%3D'<commit_msg>updated with the correct URL<commit_after><#
    .DESCRIPTION
THis gets the licensefile for one of the ISV. Even though the template is public, it wont run in any account.


    .NOTES
        AUTHOR: PK
        LASTEDIT: Mar 30, 2016
#>
workflow Get-FortinetLicense
{


    [OutputType([string])]
	
	
    param (
    [Parameter(Mandatory=$true)]
    [string] 
    $Tdid,
    
    [Parameter(Mandatory=$true)]
    [string] 
    $accountName,
    
    [Parameter(Mandatory=$true)]
    [string] 
    $variableName,
    
    [Parameter(Mandatory=$true)]
    [string] 
    $ISVName,
    
    [Parameter(Mandatory=$true)]
    [string] 
    $credentialName,
    
    [Parameter(Mandatory=$true)]
    [string] 
    $resourceGroupName
    
    )
    
    #The name of the Automation Credential Asset this runbook will use to authenticate to Azure.
    $CredentialAssetName = $credentialName

    #Get the credential with the above name from the Automation Asset store
    $Cred = Get-AutomationPSCredential -Name $CredentialAssetName
    if(!$Cred) {
        Throw "Could not find an Automation Credential Asset named '${CredentialAssetName}'. Make sure you have created one in this Automation Account."
    }

    #Connect to your Azure Account
    #Add-AzureAccount -Credential $Cred
    Add-AzureRmAccount -Credential $Cred
	
	

    $Account1 = $accountName
 #$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
#$headers.Add("x-api-key", '<KEY>')
	
	$headers = @{
    'x-api-key'= '<KEY>'
}
	
	
	$fnbody = @{
    testdriveid=$Tdid
}
$json = $fnbody | ConvertTo-Json
$invokeUrl = 'https://sxmguodehi.execute-api.us-west-2.amazonaws.com/prod/licenseManager/'+ $Tdid +'/reserveLicense?apikey=<KEY>'
$response = Invoke-RestMethod $invokeUrl -Method Put -Headers $headers -Body $json -ContentType 'application/json'
	
   # $blobURL ='https://fortinetkeys.blob.core.windows.net/licensefiles/arm_template-3.json.zip?st=2016-03-29T03%3A44%3A25Z&se=2016-03-29T07%3A04%3A25Z&sp=r&sv=2015-04-05&sr=b&sig=8qXrBQF0AWcXU6XXOwjCvQhiycy4mqvMmrZhYLdaW4k%3D'
{'fraction_non_alphanumeric': 0.12401574803149606, 'fraction_numerical': 0.027066929133858268, 'mean_word_length': 3.3993506493506493, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1849460', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1384, 'n_words': 297}