all scripts

This commit is contained in:
Alexpolo1
2023-03-09 09:06:25 +01:00
parent 49b677d254
commit bf7c3012b7
115 changed files with 68517 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
$dateToday = Get-Date
$dateYesterday = $dateToday.AddDays(-1)
$logfile = "D:\IFSBOSystem\Log\DCP_Mover.log"
Set-Location ("D:\IFSBOData\FSV\Incoming\DCP_ud\{0:d4}\{1:d2}" -f $dateYesterday.Year, $dateYesterday.Month)
$dateToday.ToString('[yyyy-MM-dd HH:mm:ss] ') | Out-File -FilePath $logfile -NoNewline -Append
"------ New run starting ------" | Out-File -FilePath $logfile -Append
$files = Get-ChildItem * -Recurse | Where-Object { $_.Attributes -notmatch 'Directory' } | Where-Object { $_.Directory -notmatch ("IFSBOData\\FSV\\Incoming\\DCP_ud\\{0:d4}\\{1:d2}\\{2:d2}" -f $dateToday.Year, $dateToday.Month, $dateToday.Day) }
$destination = 'D:\IFSBOData\FSV\Incoming\DCP_ud'
foreach($file in $files) {
$dateToday.ToString('[yyyy-MM-dd HH:mm:ss] ') | Out-File -FilePath $logfile -NoNewline -Append
"Moving '$($file.FullName)' to '$destination'" | Out-File -FilePath $logfile -Append
$file | Move-Item -Destination $destination
}
$dateToday.ToString('[yyyy-MM-dd HH:mm:ss] ') | Out-File -FilePath $logfile -NoNewline -Append
"------ Run ended ------" | Out-File -FilePath $logfile -Append