sourcePath and copy-item edited

This commit is contained in:
jonas@geiger-natur.de
2024-06-27 21:13:13 +02:00
parent d9a63e25fd
commit 34b1ac0a5f

View File

@@ -1,5 +1,4 @@
$sourcePath = "Downloads" $sourcePath = "C:\Users\YourUsername\Downloads"
$destinationPath = "\\YourServer\YourShare" $destinationPath = "\\YourServer\YourShare"
$fileExtensions = @("exe", "msi", "iso", "img") $fileExtensions = @("exe", "msi", "iso", "img")
$pattern = "[A-Za-z]+" $pattern = "[A-Za-z]+"
@@ -35,7 +34,7 @@ while ($true) {
$destFolder = $extensionFolder $destFolder = $extensionFolder
} }
Copy-Item -Path $file.FullName -Destination "$($destFolder)\$($now.ToString("yyyy-mm-dd"))_$($file.Name)" -Force Copy-Item -Path $file.FullName -Destination "$($destFolder)\$($now.ToString("yyyy-MM-dd"))_$($file.Name)" -Force
} }
Start-Sleep -Seconds 600 Start-Sleep -Seconds 600