public/Remove-ProcessedFixtureLog.ps1

function Remove-ProcessedFixtureLog {
    <#
        .EXAMPLE
            Remove-ProcessedFixtureLog -Continent north-america -Date 2025\07 -Type predictions -Path C:\sportsmonk
         
    #>

    param(

        [Parameter(Mandatory=$true)]
        [ValidateSet('australia','europe','europe-uk','europe-uk-cup','europe-uk-fl','europe-uk-wsl','south-america','north-america','asia')]
        [string]$Continent,

        [Parameter(Mandatory=$true)]
        [ValidateNotNullOrEmpty()]
        [string]$Date,

        [Parameter(Mandatory=$true)]
        [ValidateNotNullOrEmpty()]
        [string]$Path,

        [Parameter(Mandatory=$true)]
        [ValidateSet('media','predictions','results')]
        [string]$Type
        
    )
    process{

        $ErrorActionPreference = 'Stop'

        try {

            $Competions = Select-FootballCompetition -Continent $Continent
            $Competions | Format-Table
            $Competions.GetEnumerator() | ForEach-Object -Process {

                # C:\sportsmonk\fixture-artifact\processed-fixtures\2025\07\media\arg-ligaprofesional
                # C:\sportsmonk\fixture-artifact\processed-fixtures\2025\07\predictions\arg-ligaprofesional

                $PathExists = Test-Path -Path "$Path\fixture-artifact\processed-fixtures\$Date\$Type\$($_.Key)" -ErrorAction Stop

                if ($PathExists) {

                    Remove-Item -Path "$Path\fixture-artifact\processed-fixtures\$Date\$Type\$($_.Key)\*" -Force -Confirm:$false -Verbose -ErrorAction Stop

                } # if

            } # foreach-object

        }
        catch {

            "$($MyInvocation.MyCommand.Name): $_.Exception.Message"

        } # trycatch

    } # process

} # function