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 »

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: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Powershell

Post by radio42 »

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 »

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: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Powershell

Post by radio42 »

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 »

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: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Powershell

Post by radio42 »

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 »

thank you, It works!

Post Reply