Created
August 6, 2020 14:29
-
-
Save khaosx/bff5d7cd0f99224ad5ee15e4cd68b168 to your computer and use it in GitHub Desktop.
Runs from a scheduled task to process any cmd files for transcoding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# process-queue.ps1 | |
# | |
# Copyright 2020 - K. Austin Newman | |
# Version: 1.0 | |
# Runs from a scheduled task to process any cmd files for transcoding | |
## Define variables | |
$dirBaseVolName = "Data" | |
$dirWorkflowRoot = "Workflows" | |
$dirWorkflowName = "Transcoding" | |
### Find drive letters for Data | |
$volumes = @(Get-Volume | foreach {$_.FileSystemLabel}) | |
if ( $volumes -contains "$dirBaseVolName" ) { | |
$drvData = get-volume -FileSystemLabel "$dirBaseVolName" | |
$strRootVol = $drvData.DriveLetter | |
} | |
else { | |
Write-warning "Volume $dirBaseVolName not found" | |
exit 1 | |
} | |
$dirWorkFlow = "$strRootVol`:\$dirWorkflowRoot\$dirWorkflowName" | |
$dirQueue = "$dirWorkFlow\Queue" | |
if ( $Null -eq (get-process "ffmpeg" -ea SilentlyContinue )){ | |
$strCallCMD = Get-ChildItem $dirQueue -Filter *.cmd -File -Name | Select-Object -First 1 | |
Invoke-Item "$dirQueue\$strCallCMD" | |
} | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment