-
Notifications
You must be signed in to change notification settings - Fork 0
/
reaper-setup.ps1
61 lines (50 loc) · 2.17 KB
/
reaper-setup.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Import-Module BitsTransfer
Write-Host "Reaper Setup Script"
$RecordingDate = Get-Date -Format yyyy-MM-dd
$RecordingDateIncTime = Get-Date -Format yyyy-MM-dd-HHmm
Set-Location "C:\recordings"
$RecordingDirectory=".\$RecordingDateIncTime";
$Destination = "\\VBOXSVR\scripts"
$Timeout = 10 # seconds
if(!(Test-Path -path $RecordingDirectory))
{
New-Item -Itemtype directory -Path $RecordingDirectory
Write-Host "Folder path has been created successfully at: " $RecordingDirectory
}
else {
Write-Host "The folder name $RecordingDirectory already exists"
}
Write-Host "*** Preparing Template file ***"
Start-sleep -s 5
Copy-Item "C:\Recordings\Eastgate-Broadcast-Template.RPP" -Destination "$RecordingDirectory\$RecordingDateIncTime.RPP"
# Launch Reaper - leave script running
Write-Host "Launching Reaper....." -ForegroundColor magenta
Write-Host ""
Start-sleep -s 5
Invoke-Item "./$RecordingDirectory/$RecordingDateIncTime.RPP"
Write-Host "Preparing to copy files to server" -ForegroundColor magenta
Write-Host ""
Write-Host "Note:The computer will automatically shutdown once the transfer is complete." -ForegroundColor red
# Prompt to Copy Files to server
$confirmation = Read-Host "Are you sure you want to proceed: Enter y or n "
if ($confirmation -eq 'y') {
Write-Host "Copy starting"
Write-Host ""
New-Item -Itemtype directory -Path "$Destination\$RecordingDirectory"
Write-Host "Destination Directory created"
# Copy LV1 Session file to destination
Write-Host "Copy LV1 Session file to NAS started"
# copy-item -path "\\lv1\c$\Users\Public\Waves\eMotion\$RecordingDate.emo" -Destination "$Destination"
Write-Host "Copy LV1 Session file to NAS finished"
# Copy Reaper Session files to destination
Write-Host "Copy Reaper Session files to NAS started"
Start-BitsTransfer -Source $RecordingDirectory\*.* -Destination "$Destination\$RecordingDirectory" -Description "Server-Transfer" -DisplayName "Server-Transfer"
Write-Host "Copy Reaper Session files to NAS finished"
Write-Host "Transfers Complete.....Shutting Down"
# start-sleep -s 5
# Stop-Computer -ComputerName localhost
}
else {
Write-Host "Copy cancelled"
}
#Test ending