<commit_before>﻿function Read-DbaXEventsFile {
 <#
	.SYNOPSIS
	Get a list of Extended Events Sessions

	.DESCRIPTION
	Retrieves a list of Extended Events Sessions

	.PARAMETER SqlInstance
	The SQL Instances that you're connecting to.

	.PARAMETER SqlCredential
	Credential object used to connect to the SQL Server as a different user

	.PARAMETER Session
	Only return specific sessions. This parameter is auto-populated.
		
	.PARAMETER Silent
	If this switch is enabled, the internal messaging functions will be silenced.

	.NOTES
	Tags: Memory
	Author: <NAME> ( @PowerDBAKlaas )
	Website: https://dbatools.io
	Copyright: (C) <NAME>, <EMAIL>
	License: GNU GPL v3 https://opensource.org/licenses/GPL-3.0

	.LINK
	https://dbatools.io/Read-DbaXEventsFile

	.EXAMPLE
	Read-DbaXEventsFile -SqlInstance ServerA\sql987

	Returns a custom object with ComputerName, SQLInstance, Session, StartTime, Status and other properties.

	.EXAMPLE
	Get-DbaXEventsSession -SqlInstance sql2014 -Session deadlocks | Read-DbaXEventsFile
	
	Reads remote xevents 

#>
	[CmdletBinding()]
	param (
		[parameter(Mandatory, ValueFromPipeline)]
		[object[]]$Path,
		[switch]$Silent
	)
	process {
		if ($Path.RemoteTargetFile) {
			$instance = [dbainstance]$Path.ComputerName
			
			if ($instance.IsLocal) {
				$Path = $Path.TargetFile
			}
			else {
				$Path = $Path.RemoteTargetFile
			}
		}
		
		foreach ($file in $path) {
			
			if (-not $Exact) {
				$file = $file.Replace('.xel', '*.xel')	
			}
			
			New-Object Microsoft.SqlServer.XEvent.Linq.QueryableXEventData($file)
			#[pscustomobject]($d.actions | Select-Object Name, Value)
		}
	}
}<commit_msg>add the other filetype<commit_after>﻿function Read-DbaXEventsFile {
 <#
	.SYNOPSIS
	Get a list of Extended Events Sessions

	.DESCRIPTION
	Retrieves a list of Extended Events Sessions

	.PARAMETER SqlInstance
	The SQL Instances that you're connecting to.

	.PARAMETER SqlCredential
	Credential object used to connect to the SQL Server as a different user

	.PARAMETER Session
	Only return specific sessions. This parameter is auto-populated.
		
	.PARAMETER Silent
	If this switch is enabled, the internal messaging functions will be silenced.

	.NOTES
	Tags: Memory
	Author: <NAME> ( @PowerDBAKlaas )
	Website: https://dbatools.io
	Copyright: (C) <NAME>, <EMAIL>
	License: GNU GPL v3 https://opensource.org/licenses/GPL-3.0

	.LINK
	https://dbatools.io/Read-DbaXEventsFile

	.EXAMPLE
	Read-DbaXEventsFile -SqlInstance ServerA\sql987

	Returns a custom object with ComputerName, SQLInstance, Session, StartTime, Status and other properties.

	.EXAMPLE
	Get-DbaXEventsSession -SqlInstance sql2014 -Session deadlocks | Read-DbaXEventsFile
	
	Reads remote xevents 

#>
	[CmdletBinding()]
	param (
		[parameter(Mandatory, ValueFromPipeline)]
		[object[]]$Path,
		[switch]$Silent
	)
	process {
		if ($Path.RemoteTargetFile) {
			$instance = [dbainstance]$Path.ComputerName
			
			if ($instance.IsLocal) {
				$Path = $Path.TargetFile
			}
			else {
				$Path = $Path.RemoteTargetFile
			}
		}
		
		foreach ($file in $path) {
			
			if (-not $Exact) {
				$file = $file.Replace('.xel', '*.xel')
				$file = $file.Replace('.xem', '*.xem')
			}
			
			New-Object Microsoft.SqlServer.XEvent.Linq.QueryableXEventData($file)
			#[pscustomobject]($d.actions | Select-Object Name, Value)
		}
	}
}
{'fraction_non_alphanumeric': 0.1068517959553275, 'fraction_numerical': 0.006036824630244492, 'mean_word_length': 3.7342857142857144, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 6, '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': '951861', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1096, 'n_words': 298}