Automating OBS from PowerShell Script

Open Broadcaster Software (OBS) is a great, open source, product that can be used to capture, record and stream a mixture of sources. With support for Decklink cards, it is easy to include the output of an ATEM vision mixer.

Using Windows PowerShell would let you automate OBS using XKeys or a Midi device and even coordinate switching ATEM inputs or playing out graphics from CasparCG at the same time (see my other PowerShell add-ons in

What you need:

Web Socket add-in for OBS

The following files in your Documents\WindowsPowerShell directory (remember to un-block them after downloading)
Zip File containing:


Sample script

Add-Type -path ‘documents\WindowsPowerShell\obs-websocket-dotnet.dll’
$obs = new-object OBSWebsocketDotNet.OBSWebsocket
$obs.Connect(“ws://”, “password”)
$scenes = $obs.ListScenes()
#Loop through each scene
$loop = $true; $i =1

if($i -eq $scenes.Count){$i=1}
Start-Sleep 5
#Other commands

All methods and properties for OBS Websocket:

3 thoughts on “Automating OBS from PowerShell Script”

  1. this is amazing!! you must be a genius! Thanks for sharing this!
    PS: Please, if you release some updates to this plugin, send me an notification, or let me know how to customize it further, as in the future they may release other functions thus new API calls.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.