Functions/New-GuitarRecord.ps1


function New-GuitarRecord {

    $VideoRecordFolder = "$($env:OneDrive)\Guitar\VideoRecord"
    $Date = Get-Date -Format "yyyyMMdd"
    
    $CakewalkTemplateProject = "$VideoRecordFolder\Template\Template"
    $ShotcutTemplateProject = "$VideoRecordFolder\Template\Template.mlt"

    $Artist = Read-Host -Prompt "Artist" 

    $Title = Read-Host -Prompt "Title"

    if(!($Artist) -or !($Title)) {
        break
    }

    #$NewProjectName = "Dragon Force - Through the fire and the Flames"
    $NewProjectName = "$Artist - $Title"

    $NewProjectFolder = "$VideoRecordFolder\$Date - $NewProjectName"
    $NewProjectFolderAudio = "$NewProjectFolder\A"
    $NewProjectFolderVideo = "$NewProjectFolder\V"
    

    ##

    #ls $VideoRecordFolder

    #$Date

    ##

    New-Item -ItemType Directory $NewProjectFolder -Force
    New-Item -ItemType Directory $NewProjectFolderVideo -Force
    New-Item -ItemType Directory $NewProjectFolderAudio -Force


    #Start-Process "Robocopy" -ArgumentList "$CakewalkTemplateProject $NewProjectFolderAudio /MIR" -Wait -PassThru
    Robocopy.exe $CakewalkTemplateProject $NewProjectFolderAudio /MIR

    Rename-Item "$NewProjectFolderAudio\Template.cwp" "$NewProjectFolderAudio\$NewProjectName.cwp"

    Copy-Item $ShotcutTemplateProject $NewProjectFolderVideo
    Rename-Item "$NewProjectFolderVideo\Template.mlt" "$NewProjectName.mlt"

    explorer $NewProjectFolder

    ##

}