Skip to content
Ian Morrish edited this page Feb 26, 2016 · 9 revisions

Welcome to the GasparCG-PowerShell wiki! This project contains PowerShell utilities, Modules and advice to help with Broadcast Automation using Windows PowerShell. Currently I'm automating CasparCG, Blackmagic ATEM and Hyperdeck with Windows PowerShell.

Why PowerShell? It is included in all modern versions of Windows (desktop and servers). It is built on Microsoft.Net so it can pretty much automate any modern Windows system/application and provides backward compatibility for older Com+ model. Microsoft is investing heaps into PowerShell for automation and it is currently up to version 5.0. There are thousands of great examples on the web to learn PowerShell and several communities providing support and script libraries. If you have not heard of PowerShell then check out https://en.wikipedia.org/wiki/Windows_PowerShell

Introduction to automating CasparCG with Windows Powershell. The following screen shot shows the PowerShell Integrated Scripting Environment (ISE) with a script that extracts the thumbnail of a video from the CG server and displays it in a dialog box. Thumbnail image of video file from CasparCG server

Three things you need to get started.

  1. Windows 7,8.1 or 10 (or server 2008R2, 2012, 2012R2 with ISE feature enabled).
  2. Enable running of .PS1 script files. To do this, from the Start menu type Powershell, right click on the result and "Run As Administrator". Then type Set-ExecutionPolicy RemoteSigned
  3. Download the 3 CasparCGNetConnector files from https://github.com/mcdikki/CasparCGNetConnector/tree/master/CasparCGNETConnector/bin/Release and place them in your \Documents\WindowsPowerShell directory (don't forget to un-block them)

You can then connect to a CasparCG server using these simple commands in a PowerShell window"

add-type -path 'C:\Users\Imorrish\Documents\WindowsPowerShell\CasparCGNETConnector.dll'

$casparcg = new-object "CasparCGNETConnector.CasparCGConnection"

$casparcg.connect("videopc",5250)

$casparcg.sendCommand("play 1-1 ARISE_HeyO")

$casparcg.close()

Next, create a CasparCG folder in your Documents\WindowsPowerShell\Modules directory and place the psm1 and psd1 files from this project there. Run PowerShell ISE and type Import-Module CasparCG Try typing New-Command and you should see the type ahead and parameter hint. See the wiki for more details.

Clone this wiki locally