완성된 TS 파일 이동기

7r·2024년 2월 11일

PowerShell Script

목록 보기
1/2
function Move-CompletedTSfile {
    param(
        [String]$searchFileName = "ts",
        [string]$rootDestinationFolder = ".."
    )

    $destinationFolder = Join-Path $rootDestinationFolder $searchFileName

    if (-not (Test-Path $destinationFolder -PathType Container)) {
        $null = New-Item $destinationFolder -ItemType Directory
    }

    Get-ChildItem -Path $PWD -Filter "*$searchFileName*" -Recurse -File |
    Where-Object { $_.LastWriteTime -lt (Get-Date).AddSeconds(-120) } |
    Move-Item -Destination $destinationFolder

    Set-Location $destinationFolder
}

profile
7r 입니다.

0개의 댓글