<commit_before>﻿Function Add-XLSheet {
[CmdletBinding()]
[OutputType([object])]
param(
    [Parameter(ParameterSetName = "Package", Mandatory = $true, ValueFromPipeline = $true)]
    [OfficeOpenXml.ExcelPackage]$Package,
    [Parameter(ParameterSetName = "Path", Mandatory = $true)]
    [string]$Path,
    [string]$Name,
    [string]$Hidden = $false,
    [switch]$Force = $false,
    [switch]$PassThru = $false,
    [scriptblock]$With = $null
)
begin{}
process{
    if ($PSCmdlet.ParameterSetName -eq "Path") {
        $resolvedPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path);
        if (!Test-Path -LiteralPath $resolvedPath) {
            throw "Path not found: '$Path'";
        }
        $Package = [OfficeOpenXml.ExcelPackage]::new($resolvedPath);
    }<commit_msg>Fix for #3 usage of -Path parameter on Add-XLSheet throws error.<commit_after>﻿Function Add-XLSheet {
[CmdletBinding()]
[OutputType([object])]
param(
    [Parameter(ParameterSetName = "Package", Mandatory = $true, ValueFromPipeline = $true)]
    [OfficeOpenXml.ExcelPackage]$Package,
    [Parameter(ParameterSetName = "Path", Mandatory = $true)]
    [string]$Path,
    [string]$Name,
    [string]$Hidden = $false,
    [switch]$Force = $false,
    [switch]$PassThru = $false,
    [scriptblock]$With = $null
)
begin{}
process{
    if ($PSCmdlet.ParameterSetName -eq "Path") {
        $resolvedPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path);
        if (-not (Test-Path -LiteralPath $resolvedPath)) {
            throw "Path not found: '$Path'";
        }
        $Package = [OfficeOpenXml.ExcelPackage]::new($resolvedPath);
    }
{'fraction_non_alphanumeric': 0.1528358208955224, 'fraction_numerical': 0.0005970149253731343, 'mean_word_length': 4.017964071856287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '3175781', 'n_tokens_mistral': 521, 'n_tokens_neox': 510, 'n_words': 101}