<commit_before><#  
.SYNOPSIS  
    powershell script to connect to quickstart rds deployments after deploying template

.DESCRIPTION  
    https://gallery.technet.microsoft.com/Azure-Resource-Manager-4ea7e328
    
    ** REQUIRES AT LEAST WMF 5.0 AND AZURERM SDK **
    script authenticates to azure rm 
    queries all resource groups for public ip name
    gives list of resource groups
    enumerates public ip of specified resource group
    downloads certificate from RDWeb
    adds cert to local machine trusted root store
    tries to resolve subject name in dns
    if not the same as public loadbalancer ip address it is added to hosts file
    
    start with -verbose if you need to troubleshoot script

.NOTES  
   NOTE: to remove certs from all stores Get-ChildItem -Recurse -Path cert:\ -DnsName *<%subject%>* | Remove-Item
   File Name  : azure-rm-rdp-post-deployment.ps1
   Version    : 170602 fix for wildcard certs
   History    : 
                170524 another change for azurerm.resources coming back not as collection for single sub?
                170405 cleaned up and added -rdWebUrl
                161230 changed runas-admin to call powershell with -executionpolicy bypass
.EXAMPLE  
    .\azure-rm-rdp-post-deployment.ps1
    query azure rm for all resource groups with for all public ips.

.EXAMPLE
    .\azure-rm-rdp-post-deployment.ps1 -rdWebUrl https://contoso.eastus.cloudapp.azure.com/RDWeb
    used to bypass Azure enumeration and to copy cert from url to local cert store

.PARAMETER noPrompt
    to not prompt when adding cert to cert store or when modifying hosts file
 
.PARAMETER rdWebUrl
    used to pass complete RDWeb url to script to bypass Azure enumeration. will add self-signed cert to cert store.

.PARAMETER resourceManagerName
    optional parameter to specify Resource Group Name

.PARAMETER publicIpAddressName
    optional parameter to override ip resource name public ip address

.PARAMETER update
    optional parameter to check for updated script from github

#>  
 

param(
    [Parameter(Mandatory = $false)]
    [string][ValidateSet('LocalMachine', 'CurrentUser')] $certLocation = "LocalMachine",<commit_msg>updated version<commit_after><#  
.SYNOPSIS  
    powershell script to connect to quickstart rds deployments after deploying template

.DESCRIPTION  
    https://gallery.technet.microsoft.com/Azure-Resource-Manager-4ea7e328
    
    ** REQUIRES AT LEAST WMF 5.0 AND AZURERM SDK **
    script authenticates to azure rm 
    queries all resource groups for public ip name
    gives list of resource groups
    enumerates public ip of specified resource group
    downloads certificate from RDWeb
    adds cert to local machine trusted root store
    tries to resolve subject name in dns
    if not the same as public loadbalancer ip address it is added to hosts file
    
    start with -verbose if you need to troubleshoot script

.NOTES  
   NOTE: to remove certs from all stores Get-ChildItem -Recurse -Path cert:\ -DnsName *<%subject%>* | Remove-Item
   File Name  : azure-rm-rdp-post-deployment.ps1
   Version    : 170617 authenticate-azurerm
   History    : 
                170602 fix for wildcard certs
                170524 another change for azurerm.resources coming back not as collection for single sub?

.EXAMPLE  
    .\azure-rm-rdp-post-deployment.ps1
    query azure rm for all resource groups with for all public ips.

.EXAMPLE
    .\azure-rm-rdp-post-deployment.ps1 -rdWebUrl https://contoso.eastus.cloudapp.azure.com/RDWeb
    used to bypass Azure enumeration and to copy cert from url to local cert store

.PARAMETER noPrompt
    to not prompt when adding cert to cert store or when modifying hosts file
 
.PARAMETER rdWebUrl
    used to pass complete RDWeb url to script to bypass Azure enumeration. will add self-signed cert to cert store.

.PARAMETER resourceManagerName
    optional parameter to specify Resource Group Name

.PARAMETER publicIpAddressName
    optional parameter to override ip resource name public ip address

.PARAMETER update
    optional parameter to check for updated script from github

#>  
 

param(
    [Parameter(Mandatory = $false)]
    [string][ValidateSet('LocalMachine', 'CurrentUser')] $certLocation = "LocalMachine",
{'fraction_non_alphanumeric': 0.05188679245283019, 'fraction_numerical': 0.014622641509433962, 'mean_word_length': 3.199009900990099, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6203195', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1155, 'n_words': 493}