Sometime you want to leverage internal services to allow users to notify groups when things happen in realtime such as deployments. In this example we have done exactly this simple script posts a message to the slack channel of choice using a list custom attribute on the form at request time. 


  • vCommander send message to slack Script  (Download here)
  • PowerShell v4 or higher on the vCommander application server
  • Embotics® vCommander® 6.1.X or later

In vCommander create a simple list custom attribute set to all types and add only the channels that you would like end users to be able to select and notify. 


Then add the attribute to your default service form or to the forms for specific organizations. 

Next we need to update the Script and Completion workflow, Save the script to a location on the vCommander server usually c:\Scripts  open the file and Edit the Bot Name if you like and insert your Slack API token that has access to the channels that you setup on the custom attribute above (in case any are private channels).

Now that it's configured time to setup the completeion workflow to execute the Script as the last step before the vm is released to the requester. Edit the completion workflow that you would like to add the notification rule. Add a new execute Script step, make sure its the last step in the workflow. Edit the step name and set the step execution to conditional. 

Edit the conditional step and add the following:     "#{request.service.settings.customAttribute['Notify Slack Channel']}" -ne ""  click "OK" to save. 

In the Command line field add the following command ensuring the execution path to the script is correct. you can add or remove variable data to this message as it suits your environment 

powershell.exe c:\scripts\slack\send_message_to_slack.ps1 -channel '#{request.service.settings.customAttribute['Notify Slack       Channel']}' -message 'Recently deployed  VM/Instance #{target.Name} on #{target.managedSystem.type}'

Now when a Service is requested and the requester specifies a Slack channel off of the form there will be a notification in slack for that deployment.