<commit_before>﻿<#
    .SYNOPSIS
       Add a synopsis here to explain the PSScript. 

    .Description
        Give a description of the Script.

#>
Param(

)
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
$CompletedParameters = Write-StartingMessage -CommandName Save-SkypeOnlineAudioData

$GlobalVars = Get-BatchAutomationVariable -Prefix 'zzGlobal' `
                                          -Name 'WorkspaceId'

$SharePointVars = Get-BatchAutomationVariable -Prefix 'SharePoint' `
                                              -Name 'CredentialName'

$WorkspaceCredential = Get-AutomationPSCredential -Name $GlobalVars.WorkspaceID
$Key = $WorkspaceCredential.GetNetworkCredential().Password

$Credential = Get-AutomationPSCredential -Name $SharePointVars.CredentialName
Try
{
    $DataToSave = @()
    Connect-MsolService -Credential $Credential
    
    $Sku = Get-MsolAccountSku
    Write-LogAnalyticsLogEntry -WorkspaceId $GlobalVars.WorkspaceId -Key $Key -Data $Sku -LogType 'Office365License_CL'
}
Catch
{
    $Exception = $_
    $ExceptionInfo = Get-ExceptionInfo -Exception $Exception
    Switch ($ExceptionInfo.FullyQualifiedErrorId)
    {
        Default
        {
            Write-Exception $Exception -Stream Warning
        }
    }
}

Write-CompletedMessage @CompletedParameters<commit_msg>updates<commit_after>﻿<#
    .SYNOPSIS
       Add a synopsis here to explain the PSScript. 

    .Description
        Give a description of the Script.

#>
Param(

)
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
$CompletedParameters = Write-StartingMessage -CommandName Save-SkypeOnlineAudioData

$GlobalVars = Get-BatchAutomationVariable -Prefix 'zzGlobal' `
                                          -Name 'WorkspaceId'

$SharePointVars = Get-BatchAutomationVariable -Prefix 'SharePoint' `
                                              -Name 'CredentialName'

$WorkspaceCredential = Get-AutomationPSCredential -Name $GlobalVars.WorkspaceID
$Key = $WorkspaceCredential.GetNetworkCredential().Password

$Credential = Get-AutomationPSCredential -Name $SharePointVars.CredentialName
Try
{
    $DataToSave = @()
    Connect-MsolService -Credential $Credential
    
    $Sku = Get-MsolAccountSku

    Foreach($_Sku in $SKU)
    {
        $_Sku = $_Sku | ConvertTo-JSON | ConvertFrom-JSON | ConvertFrom-PSCustomObject
        $_SKU.Add('AvailableUnits', ($_SKU.ActiveUnits - $_SKU.ConsumedUnits))
        $DataToSave += $_Sku
    }
    
    Write-LogAnalyticsLogEntry -WorkspaceId $GlobalVars.WorkspaceId -Key $Key -Data $DataToSave -LogType 'Office365License_CL'
}
Catch
{
    $Exception = $_
    $ExceptionInfo = Get-ExceptionInfo -Exception $Exception
    Switch ($ExceptionInfo.FullyQualifiedErrorId)
    {
        Default
        {
            Write-Exception $Exception -Stream Warning
        }
    }
}

Write-CompletedMessage @CompletedParameters
{'fraction_non_alphanumeric': 0.08929182346903866, 'fraction_numerical': 0.0020526855969893944, 'mean_word_length': 2.9248322147651007, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3738274', 'n_tokens_mistral': 836, 'n_tokens_neox': 838, 'n_words': 166}