$novels = @( "astral-pet-store", "emperors-domination", "i-became-the-male-leads-adopted-daughter", "infinite-mage-remake", "my-disciples-are-all-villains", "nano-machine", "omniscient-readers-viewpoint", "reaper-of-the-drifting-moon", "reincarnation-of-the-strongest-sword-god", "remarried-empress", "silent-witch", "the-eternal-supreme", "the-great-mage-returns-after-4000-years", "the-player-hides-his-past", "the-steward-demonic-emperor", "turns-out-im-in-a-villain-clan" ) $baseDir = "c:\Users\a.dchar\Documents\privé\lab\lastwebnovel" foreach ($slug in $novels) { $sourceFile = "$baseDir\content\novels\$slug\cover.png" $destDir = "$baseDir\public\images\$slug" $destFile = "$destDir\cover.png" # Create destination directory if it doesn't exist if (!(Test-Path $destDir)) { New-Item -ItemType Directory -Path $destDir -Force | Out-Null Write-Host "Created: $slug" } # Copy the file if (Test-Path $sourceFile) { Copy-Item -Path $sourceFile -Destination $destFile -Force Write-Host "Copied: $slug" } else { Write-Host "Not found: $sourceFile" } } Write-Host "All done!"