```powershell
$sourcePath = "C:\Source"
$backupPath = "C:\Backup"
$thresholdDate = (Get-Date).AddDays(-7)
if (-not (Test-Path $backupPath)) {
New-Item -ItemType Directory -Path $backupPath -Force | Out-Null
}
$filesToCopy = Get-ChildItem -Path $sourcePath -File | Where-Object {
$_.LastWriteTime -ge $thresholdDate
}
$copiedFiles = @()
foreach ($file in $filesToCopy) {
$destinationPath = Join-Path $backupPath $file.Name
Copy-Item -Path $file.FullName -Destination $destinationPath -Force
$copiedFiles += $file.Name
}
Write-Host "Скопировано $($copiedFiles.Count) файла(ов):"
foreach ($fileName in $copiedFiles) {
$file = Get-Item (Join-Path $sourcePath $fileName)
Write-Host " $fileName (изменён $($file.LastWriteTime.ToString('yyyy-MM-dd')))"
}
```