<commit_before>function Get-SecDeviceInventory 
{

     <#

        Synopsis
        Control 1: Inventory of Authorized and Unauthorized Devices
        Uses AD to generate a list of devices that are on the network, exports it to a XML document.
        Checks to see if a baseline exists, and if one does not, renames the current report to the baseline, then runs itself again. Upon completion, calls sister-function
   
    #>

    [string]$filename = Get-DateISO8601 -Prefix ".\Device-Inventory" -Suffix ".xml"
    Get-ADComputer -Filter * | Select-Object DistinguishedName,DNSHostName,Name,SAMAccountName,ObjectGUID | Export-Clixml $filename
 
    if(-NOT(Test-Path ".\Baselines\Device-Inventory-Baseline.xml"))
	    {
		    Rename-Item $filename "Device-Inventory-Baseline.xml"
            Move-Item ".\Device-Inventory-Baseline.xml" .\Baselines
		    Write-Warning "Baseline list now created"
	   	    Invoke-Expression $MyInvocation.MyCommand
	    }
    else
        {
            Compare-SecDeviceList<commit_msg>Update Get-SecDeviceInventory.ps1<commit_after>function Get-SecDeviceInventory 
{

     <#

        Synopsis
        Control 1: Inventory of Authorized and Unauthorized Devices
        Uses AD to generate a list of devices that are on the network, exports it to a XML document.
        Checks to see if a baseline exists, and if one does not, renames the current report to the baseline, then runs itself again. Upon completion, calls sister-function
   
    #>

    [string]$filename = Get-DateISO8601 -Prefix ".\Device-Inventory" -Suffix ".xml"
    Get-ADComputer -Filter * | Select-Object DistinguishedName,DNSHostName,Name,SAMAccountName,ObjectGUID | Export-Clixml $filename
 
    if(-NOT(Test-Path ".\Baselines\Device-Inventory-Baseline.xml"))
	    {
		    Rename-Item $filename "Device-Inventory-Baseline.xml"
            Move-Item ".\Device-Inventory-Baseline.xml" .\Baselines
		    Write-Warning "Baseline list now created"
	   	    Invoke-Expression $MyInvocation.MyCommand
	    }
    else
        {
            Compare-SecDeviceInventory
{'fraction_non_alphanumeric': 0.0841799709724238, 'fraction_numerical': 0.005321722302854378, 'mean_word_length': 2.887218045112782, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '7382132', 'n_tokens_mistral': 623, 'n_tokens_neox': 566, 'n_words': 172}