Powershell

You have a question or need an advice about how to do something? Ask it here!
Post Reply
Soessafaria
Posts: 8
Joined: 25 Sep 2019 15:18

Powershell

Post by Soessafaria » 07 Sep 2020 20:22

Is it possible to trigger/launch a powershell script using the commands? For instance when I stop recording I trigger a powershell script that updates the recorded file to another folder or the cloud?

User avatar
radio42
Site Admin
Posts: 6264
Joined: 05 Apr 2012 16:26

Re: Powershell

Post by radio42 » 07 Sep 2020 20:35

Yes, see the control-commands in the Appendix of the User Manual.
For example see the EXEC_SHELL_COMMAND or EXEC_SHELL_COMMAND_SYNC command.

You can e.g. use the event system of the Mixer channel to trigger such command (right-click on the mixer channel name and select Edit Control Command Events...).

Soessafaria
Posts: 8
Joined: 25 Sep 2019 15:18

Re: Powershell

Post by Soessafaria » 07 Sep 2020 21:01

Ok, I am struggling to get it to work. Maybe it is a format issue

My call is now:
EXEC_SHELL_COMMAND Copy-Item C:\Users\Playout\Music\Interview.mp3 -Destination C:\Temp|normal


It does not work at the momennt, could you help me with it?

User avatar
radio42
Site Admin
Posts: 6264
Joined: 05 Apr 2012 16:26

Re: Powershell

Post by radio42 » 08 Sep 2020 08:05

Try:
EXEC_SHELL_COMMAND powershell.exe Copy-Item "C:\Users\Playout\Music\Interview.mp3" -Destination "C:\Temp"|normal

Soessafaria
Posts: 8
Joined: 25 Sep 2019 15:18

Re: Powershell

Post by Soessafaria » 08 Sep 2020 11:08

Still does not work. Could you give an example that does work? Maybe I can figure it out. Does it need any quotes?

User avatar
radio42
Site Admin
Posts: 6264
Joined: 05 Apr 2012 16:26

Re: Powershell

Post by radio42 » 11 Sep 2020 08:07

I corrected the above, it must actually be powershell.exe to start it.
Note, that the EXEC_SHELL_COMMAND effectively just launches any OS application, so the first parameter argument must be powershell.exe to start powershell itself and then followed by the command-line arguments to pass to that application.
E.g.:
EXEC_SHELL_COMMAND powershell.exe Copy-Item "C:\Users\Playout\Music\Interview.mp3" -Destination "C:\Temp"|normal

Soessafaria
Posts: 8
Joined: 25 Sep 2019 15:18

Re: Powershell

Post by Soessafaria » 25 Sep 2020 09:19

thank you, It works!

Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests