public/New-ProcessedFootballFixtureFolder.ps1
function New-ProcessedFootballFixtureFolder { <# .EXAMPLE New-ProcessedFootballFixtureFolder -Competition esp-laliga -DateYear 2025 -DateMonth 2 -Path C:\sportsmonk #> [CmdletBinding()] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Competition, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [int]$DateMonth, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [int]$DateYear, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Path ) process{ $ErrorActionPreference = 'Stop' try { if ($DateMonth -lt 10) { $DateMonthToUse = "0$DateMonth" } else { $DateMonthToUse = $DateMonth } # if $PlogPath = "$Path\fixture-artifact\processed-fixtures\$DateYear\$DateMonthToUse\predictions\$Competition" $RlogPath = "$Path\fixture-artifact\processed-fixtures\$DateYear\$DateMonthToUse\results\$Competition" $LogPathToUse =@($PlogPath,$RlogPath) # A for artifact foreach ($ALogPath in $LogPathToUse) { Write-Warning -Message "processing: $AlogPath." $logPathExists = Test-Path -Path $AlogPath if (!$logPathExists) { New-Item -Path $AlogPath -ItemType Directory -ErrorAction Stop } # if } # foreach } catch { "$($MyInvocation.MyCommand.Name): $_.Exception.Message" } # trycatch } # process } # function |