$dest = "$HOME\Desktop\Excel_Files"; New-Item -ItemType Directory -Force $dest | Out-Null; Get-PSDrive -PSProvider FileSystem | ForEach-Object { $drive = $_.Root; Write-Host "Сканирую диск $drive..."; Get-ChildItem -Path $drive -Include *.xls, *.xlsx, *.xlsm -Recurse -File -ErrorAction SilentlyContinue | ForEach-Object { Copy-Item $_.FullName -Destination $dest -ErrorAction SilentlyContinue } }; Write-Host "Готово! Все файлы скопированы в папки на рабочем столе." -ForegroundColor Green