adjusted verbosity
This commit is contained in:
parent
a607faae88
commit
7182a0b887
|
|
@ -26,18 +26,25 @@ param(
|
||||||
|
|
||||||
$AllFiles = $( Get-ChildItem -Path $InputDir -Filter 'Game_*.slp' -Depth 1 )
|
$AllFiles = $( Get-ChildItem -Path $InputDir -Filter 'Game_*.slp' -Depth 1 )
|
||||||
|
|
||||||
|
Write-Verbose "Script start. Processing [$( $AllFiles.Length )] files"
|
||||||
|
|
||||||
ForEach ($f in $AllFiles) {
|
ForEach ($f in $AllFiles) {
|
||||||
$FileName = $f.Name
|
$FileName = $f.Name
|
||||||
$FilePath = $f.FullName
|
$FilePath = $f.FullName
|
||||||
|
|
||||||
|
Write-Verbose "Processing [${FileName}]"
|
||||||
|
|
||||||
$DateString = $( ( $FileName.Split("_").Split("T") )[1] )
|
$DateString = $( ( $FileName.Split("_").Split("T") )[1] )
|
||||||
$NewDateString = $( [datetime]::ParseExact($DateString,"yyyyMMdd",$null) ).ToString('yyyy-MM')
|
$NewDateString = $( [datetime]::ParseExact($DateString,"yyyyMMdd",$null) ).ToString('yyyy-MM')
|
||||||
|
|
||||||
$NewOutputDir = $( Join-Path $OutputDir $NewDateString )
|
$NewOutputDir = $( Join-Path $OutputDir $NewDateString )
|
||||||
|
|
||||||
if ( -not ( Test-Path $NewOutputDir ) ) {
|
if ( -not ( Test-Path $NewOutputDir ) ) {
|
||||||
|
Write-Verbose "[$NewOutputDir] doesn't exist. Creating"
|
||||||
New-Item -Path $NewOutputDir -ItemType Directory
|
New-Item -Path $NewOutputDir -ItemType Directory
|
||||||
}
|
}
|
||||||
|
|
||||||
Copy-Item -Path $FilePath -Destination $( Join-Path $NewOutputDir $FileName ) -Verbose
|
Copy-Item -Path $FilePath -Destination $( Join-Path $NewOutputDir $FileName )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-Verbose "Script finished. Exiting"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue