Set-StrictMode -Version Latest . "$PSScriptRoot\helpers.ps1" . "$PSScriptRoot\process-zip.ps1" $Settings = Import-Settings $folder = $Settings.DownloadWatchFolder $pattern = $Settings.ZipPattern Write-Log "Run once scanning $folder for $pattern" if (!(Test-Path $folder)) { Write-Log "DownloadWatchFolder does not exist: $folder" "ERROR" exit 1 } $zips = Get-ChildItem -Path $folder -Filter $pattern -File | Sort-Object LastWriteTimeUtc foreach ($zip in $zips) { Invoke-DailyBuildZip -ZipPath $zip.FullName } Write-Log "Run once complete."