Example PowerShell - OpenMacroBoard/StreamDeckSharp GitHub Wiki

You can use this library in Windows PowerShell. Thanks to imorrish for providing the PowerShell example code.

Example:

add-type -path 'WindowsPowerShell\StreamDeckSharp.dll'

$deckInterface = [StreamDeckSharp.StreamDeck]::OpenDevice()

$POSH = [StreamDeckSharp.StreamDeckKeyBitmap]::FromFile(".\Pictures\PowerShell72x72.png")

$deckInterface.SetKeyBitmap(0, $POSH)

$KeyEvent = Register-ObjectEvent -InputObject $deckInterface -EventName KeyStateChanged -SourceIdentifier buttonPress -Action {write-host $eventArgs.key)}